]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Always set _useUTC to true when parsing using moment.utc()
authorTim Wood <washwithcare@gmail.com>
Fri, 26 Oct 2012 19:15:12 +0000 (08:15 -1100)
committerTim Wood <washwithcare@gmail.com>
Fri, 26 Oct 2012 19:15:12 +0000 (08:15 -1100)
moment.js

index 69b964c09ebe2e4d23e5bceed203afa938dab0d9..0c77e8921411efcfec742f7e946b615b9aed89da 100644 (file)
--- a/moment.js
+++ b/moment.js
     ************************************/
 
 
-    moment = function (input, format) {
+    moment = function (input, format, altConfigs) {
         if (input === null || input === '') {
             return null;
         }
-        var config = {
+        var config = extend({
             _i : typeof input === 'string' ? getLangDefinition().preparse(input) : input,
             _f : format,
             _isUTC : false
-        };
+        }, altConfigs || {});
 
         if (moment.isMoment(input)) {
             config = extend({}, input);
 
             return new Moment(config);
         }
-        // if we don't have a timezone, we need to add one to trigger parsing into utc
-        if (typeof input === 'string' && !parseTokenTimezone.exec(input)) {
-            input += ' +0000';
-            if (format) {
-                format += ' Z';
-            }
-        }
 
-        return moment(input, format).utc();
+        return moment(input, format, {
+            _useUTC : true
+        }).utc();
     };
 
     // creating with unix timestamp (in seconds)