]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Adding moment.fn.zone to get timezone offset
authorTim Wood <washwithcare@gmail.com>
Tue, 29 Nov 2011 17:27:24 +0000 (09:27 -0800)
committerTim Wood <washwithcare@gmail.com>
Tue, 29 Nov 2011 17:27:24 +0000 (09:27 -0800)
moment.js

index 98f7ab763a88a4ab0072965d134fb9542ace273f..d6dd055d40f776a173be485ae8d1c0f9d960734d 100644 (file)
--- a/moment.js
+++ b/moment.js
         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;