From: Remy Blom Date: Thu, 9 Oct 2014 07:31:16 +0000 (+0200) Subject: added parseTokenOffsetMs, using toInt() not parseInt(x,10) X-Git-Tag: 2.8.4~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eac23cc6ce194a7b1478af84cdecdcfec2b6777;p=thirdparty%2Fmoment.git added parseTokenOffsetMs, using toInt() not parseInt(x,10) --- diff --git a/moment.js b/moment.js index 7cafe5470..8558c186a 100644 --- 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 @@ -1104,6 +1105,7 @@ case 'A': return config._locale._meridiemParse; case 'x': + return parseTokenOffsetMs; case 'X': return parseTokenTimestampMs; case 'Z': @@ -1244,7 +1246,7 @@ 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':