this._isUTC = false;
if (keepLocalTime) {
- this.add(Math.round(this._d.getTimezoneOffset()), 'm');
+ this.add(this._dateTzOffset(), 'm');
}
}
return this;
input = input * 60;
}
if (!this._isUTC && keepLocalTime) {
- localAdjust = Math.round(this._d.getTimezoneOffset());
+ localAdjust = this._dateTzOffset();
}
this._offset = input;
this._isUTC = true;
}
}
} else {
- return this._isUTC ? offset : Math.round(this._d.getTimezoneOffset());
+ return this._isUTC ? offset : this._dateTzOffset();
}
return this;
},
localeData : function () {
return this._locale;
+ },
+
+ _dateTzOffset : function () {
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
+ // https://github.com/moment/moment/pull/1871
+ return Math.round(this._d.getTimezoneOffset() / 15) * 15;
}
});