Skip to content

Commit

Permalink
Remove zone from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed Dec 24, 2014
1 parent 5a1e0d1 commit c4b9a71
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,8 @@
return locales[name];
}

// Return a moment from input, that is local/utc/zone equivalent to model.
// Return a moment from input, that is local/utc/utcOffset equivalent to
// model.
function makeAs(input, model) {
var res, diff;
if (model._isUTC) {
Expand Down Expand Up @@ -1410,7 +1411,7 @@
}

config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
// Apply timezone offset from input. The actual zone can be changed
// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
Expand Down Expand Up @@ -2266,7 +2267,8 @@

calendar : function (time) {
// We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're zone'd or not.
// Getting start-of-today depends on whether we're locat/utc/offset
// or not.
var now = time || moment(),
sod = makeAs(now, this).startOf('day'),
diff = this.diff(sod, 'days', true),
Expand Down Expand Up @@ -2426,8 +2428,8 @@
),

// keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid.
//
// Keeping the time actually adds/subtracts (one hour)
Expand Down

0 comments on commit c4b9a71

Please sign in to comment.