Skip to content

Commit

Permalink
Merge pull request moment#2054 from elad:develop
Browse files Browse the repository at this point in the history
Call updateOffset when creating moment
  • Loading branch information
ichernev committed Dec 28, 2014
2 parents 74fd41e + bbf4271 commit ef27605
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@

deprecations = {},

lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'];
lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'],

updateInProgress = false;

// Pick the first defined of two or three arguments. dfl comes from
// default.
Expand Down Expand Up @@ -404,6 +406,13 @@
}
copyConfig(this, config);
this._d = new Date(+config._d);
// Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
moment.updateOffset(this);
updateInProgress = false;
}
}

// Duration Constructor
Expand Down

0 comments on commit ef27605

Please sign in to comment.