}
moment = function (input, format, lang, strict) {
+ var c;
+
if (typeof(lang) === "boolean") {
strict = lang;
lang = undefined;
}
- return makeMoment({
- _isAMomentObject: true,
- _i : input,
- _f : format,
- _l : lang,
- _strict : strict,
- _isUTC : false,
- _pf : defaultParsingFlags()
- });
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c = {};
+ c._isAMomentObject = true;
+ c._i = input;
+ c._f = format;
+ c._l = lang;
+ c._strict = strict;
+ c._isUTC = false;
+ c._pf = defaultParsingFlags();
+
+ return makeMoment(c);
};
// creating with utc
moment.utc = function (input, format, lang, strict) {
- var m;
+ var c;
if (typeof(lang) === "boolean") {
strict = lang;
lang = undefined;
}
- m = makeMoment({
- _isAMomentObject: true,
- _useUTC : true,
- _isUTC : true,
- _l : lang,
- _i : input,
- _f : format,
- _strict : strict,
- _pf : defaultParsingFlags()
- }).utc();
-
- return m;
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c = {};
+ c._isAMomentObject = true;
+ c._useUTC = true;
+ c._isUTC = true;
+ c._l = lang;
+ c._i = input;
+ c._f = format;
+ c._strict = strict;
+ c._pf = defaultParsingFlags();
+
+ return makeMoment(c).utc();
};
// creating with unix timestamp (in seconds)