From: Tim Wood Date: Tue, 29 Nov 2011 17:27:24 +0000 (-0800) Subject: Adding moment.fn.zone to get timezone offset X-Git-Tag: 1.2.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3aa1ad50e34e5634190cda8b66eb9cea7add6ca1;p=thirdparty%2Fmoment.git Adding moment.fn.zone to get timezone offset --- diff --git a/moment.js b/moment.js index 98f7ab763..d6dd055d4 100644 --- a/moment.js +++ b/moment.js @@ -523,6 +523,11 @@ return this._d.getDay(); }; + // add shortcut for timezone offset (no setter) + moment.fn.zone = function () { + return this._d.getTimezoneOffset(); + }; + // CommonJS module is defined if (hasModule) { module.exports = moment;