]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
added parseTokenOffsetMs, using toInt() not parseInt(x,10)
authorRemy Blom <remy.blom@hku.nl>
Thu, 9 Oct 2014 07:31:16 +0000 (09:31 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 17 Nov 2014 05:43:24 +0000 (21:43 -0800)
moment.js

index 7cafe54704e0f88bec5622da32bcdd8e599daac6..8558c186adfdbb66f4ccddfb5503e79f49c03be4 100644 (file)
--- a/moment.js
+++ b/moment.js
@@ -56,6 +56,7 @@
         parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic.
         parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
         parseTokenT = /T/i, // T (ISO separator)
+        parseTokenOffsetMs = /[\+\-]?\d+/, // 1234567890123
         parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
 
         //strict parsing regexes
         case 'A':
             return config._locale._meridiemParse;
         case 'x':
+            return parseTokenOffsetMs;
         case 'X':
             return parseTokenTimestampMs;
         case 'Z':
             break;
         // UNIX OFFSET (MILLISECONDS)
         case 'x':
-            config._d = new Date(parseInt(input, 10));
+            config._d = new Date(toInt(input));
             break;
         // UNIX TIMESTAMP WITH MS
         case 'X':