Skip to content

Commit

Permalink
Merge pull request #1468 from ichernev/feature/allow-zone-skip-adjust
Browse files Browse the repository at this point in the history
@changelog
@section enhancement
@description zone setter can now skip adjusting the hour
  • Loading branch information
icambron committed Feb 6, 2014
2 parents 8b333f5 + de6b236 commit c70beab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,8 @@
return other > this ? this : other;
},

zone : function (input) {
zone : function (input, adjust) {
adjust = (adjust == null ? true : false);
var offset = this._offset || 0;
if (input != null) {
if (typeof input === "string") {
Expand All @@ -2049,7 +2050,7 @@
}
this._offset = input;
this._isUTC = true;
if (offset !== input) {
if (offset !== input && adjust) {
addOrSubtractDurationFromMoment(this, moment.duration(offset - input, 'm'), 1, true);
}
} else {
Expand Down

0 comments on commit c70beab

Please sign in to comment.