]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Use makeAs in calendar too
authorIskren Chernev <iskren.chernev@gmail.com>
Mon, 23 Dec 2013 06:16:15 +0000 (22:16 -0800)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 23 Dec 2013 06:16:15 +0000 (22:16 -0800)
moment.js

index c29b111b787e2e66c9a35960349c034d950dbae2..87e0380dbc7241314012533e5eb3a353d91d9636 100644 (file)
--- a/moment.js
+++ b/moment.js
         calendar : function () {
             // We want to compare the start of today, vs this.
             // Getting start-of-today depends on whether we're zone'd or not.
-            var sod = (this._isUTC ? moment().zone(this.zone()) : moment()).startOf('day'),
+            var sod = makeAs(moment(), this).startOf('day'),
                 diff = this.diff(sod, 'days', true),
                 format = diff < -6 ? 'sameElse' :
                     diff < -1 ? 'lastWeek' :