}
return b + leftZeroFill(~~(10 * a / 6), 4);
},
+ z : function () {
+ return this.zoneAbbr();
+ },
+ zz : function () {
+ return this.zoneName();
+ },
X : function () {
return this.unix();
}
return this;
},
+ zoneAbbr : function () {
+ return this._isUTC ? "UTC" : "";
+ },
+
+ zoneName : function () {
+ return this._isUTC ? "Coordinated Universal Time" : "";
+ },
+
daysInMonth : function () {
return moment.utc([this.year(), this.month() + 1, 0]).date();
},
moment.updateOffset = oldOffset;
+ test.done();
+ },
+
+ "zone names" : function (test) {
+ test.expect(8);
+
+ test.equal(moment().zoneAbbr(), "", "Local zone abbr should be empty");
+ test.equal(moment().format('z'), "", "Local zone formatted abbr should be empty");
+ test.equal(moment().zoneName(), "", "Local zone name should be empty");
+ test.equal(moment().format('zz'), "", "Local zone formatted name should be empty");
+
+ test.equal(moment.utc().zoneAbbr(), "UTC", "UTC zone abbr should be UTC");
+ test.equal(moment.utc().format('z'), "UTC", "UTC zone formatted abbr should be UTC");
+ test.equal(moment.utc().zoneName(), "Coordinated Universal Time", "UTC zone abbr should be Coordinated Universal Time");
+ test.equal(moment.utc().format('zz'), "Coordinated Universal Time", "UTC zone formatted abbr should be Coordinated Universal Time");
+
test.done();
}