Эх сурвалжийг харах

Convert date into milliseconds instead of seconds

Sebastián Katzer 8 жил өмнө
parent
commit
958e2eb93f

+ 2 - 1
plugin.xml

@@ -234,10 +234,11 @@
 
     <!-- windows -->
     <platform name="windows">
+<!--
         <framework src="src/windows/lib.UW/x86/LocalNotificationProxy.winmd" target-dir="x86" arch="x86" custom="true"/>
         <framework src="src/windows/lib.UW/x64/LocalNotificationProxy.winmd" target-dir="x64" arch="x64" custom="true"/>
         <framework src="src/windows/lib.UW/ARM/LocalNotificationProxy.winmd" target-dir="ARM" arch="ARM" custom="true"/>
-
+ -->
         <js-module src="src/windows/LocalNotificationProxy.js" name="LocalNotification.Proxy" >
             <merges target="" />
         </js-module>

+ 3 - 3
src/android/notification/Request.java

@@ -241,13 +241,13 @@ public final class Request {
      */
     private Date getBaseDate() {
         if (spec.has("at")) {
-            return new Date(1000 * spec.optLong("at", 0));
+            return new Date(spec.optLong("at", 0));
         } else
         if (spec.has("firstAt")) {
-            return new Date(1000 * spec.optLong("firstAt", 0));
+            return new Date(spec.optLong("firstAt", 0));
         } else
         if (spec.has("after")) {
-            return new Date(1000 * spec.optLong("after", 0));
+            return new Date(spec.optLong("after", 0));
         } else {
             return new Date();
         }

+ 1 - 1
src/ios/APPNotificationOptions.m

@@ -338,7 +338,7 @@
 {
     double timestamp = [[self valueForTriggerOption:@"at"] doubleValue];
 
-    return [NSDate dateWithTimeIntervalSince1970:timestamp];
+    return [NSDate dateWithTimeIntervalSince1970:(timestamp / 1000)];
 }
 
 /**

+ 1 - 1
src/windows/LocalNotificationProxy/LocalNotificationProxy/LocalNotification/Trigger.cs

@@ -390,7 +390,7 @@ namespace LocalNotificationProxy.LocalNotification
         /// <returns>The date time</returns>
         private DateTime GetDateTime(long time)
         {
-            return DateTimeOffset.FromUnixTimeMilliseconds(time * 1000).LocalDateTime;
+            return DateTimeOffset.FromUnixTimeMilliseconds(time).LocalDateTime;
         }
     }
 

+ 1 - 1
www/local-notification-util.js

@@ -204,7 +204,7 @@ exports.convertTrigger = function (options) {
 
     var dateToNum = function (date) {
         var num = typeof date == 'object' ? date.getTime() : date;
-        return Math.round(num / 1000);
+        return Math.round(num);
     };
 
     if (!options.trigger)