浏览代码

Convert at only if provided

Sebastián Katzer 10 年之前
父节点
当前提交
c455704d3c
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      www/local-notification-util.js

+ 6 - 4
www/local-notification-util.js

@@ -154,11 +154,13 @@ exports.convertProperties = function (options) {
         }
     }
 
-    if (typeof options.at == 'object') {
-        options.at = options.at.getTime();
-    }
+    if (options.at) {
+        if (typeof options.at == 'object') {
+            options.at = options.at.getTime();
+        }
 
-    options.at = Math.round(options.at/1000);
+        options.at = Math.round(options.at/1000);
+    }
 
     if (typeof options.data == 'object') {
         options.data = JSON.stringify(options.data);