slight fix for stripTime when using moment-timezone

This commit is contained in:
Adam Shaw
2014-06-13 16:53:35 -07:00
parent d663c46afe
commit 4bdc2fdbda
+5 -3
View File
@@ -176,9 +176,6 @@ FCMoment.prototype.stripTime = function() {
// set the internal UTC flag
moment.fn.utc.call(this); // call the original method, because we don't want to affect _ambigZone
this._ambigTime = true;
this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset
this.year(a[0]) // TODO: find a way to do this in one shot
.month(a[1])
.date(a[2])
@@ -187,6 +184,11 @@ FCMoment.prototype.stripTime = function() {
.seconds(0)
.milliseconds(0);
// Mark the time as ambiguous. This needs to happen after the .utc() call, which calls .zone(), which
// clears all ambig flags. Same concept with the .year/month/date calls in the case of moment-timezone.
this._ambigTime = true;
this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset
return this; // for chaining
};