소스 검색

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);