moment.updateOffset = oldOffset;
+ test.done();
+ },
+
+ "getters and setters" : function (test) {
+ var a = moment([2011]);
+
+ test.equal(a.clone().zone(120).year(2012).year(), 2012, "should get and set year correctly");
+ test.equal(a.clone().zone(120).month(1).month(), 1, "should get and set month correctly");
+ test.equal(a.clone().zone(120).date(2).date(), 2, "should get and set date correctly");
+ test.equal(a.clone().zone(120).day(1).day(), 1, "should get and set day correctly");
+ test.equal(a.clone().zone(120).hour(1).hour(), 1, "should get and set hour correctly");
+ test.equal(a.clone().zone(120).minute(1).minute(), 1, "should get and set minute correctly");
+
+ test.done();
+ },
+
+ "getters" : function (test) {
+ var a = moment.utc([2012, 0, 1, 0, 0, 0]);
+
+ test.equal(a.clone().zone(120).year(), 2011, "should get year correctly");
+ test.equal(a.clone().zone(120).month(), 11, "should get month correctly");
+ test.equal(a.clone().zone(120).date(), 31, "should get date correctly");
+ test.equal(a.clone().zone(120).hour(), 22, "should get hour correctly");
+ test.equal(a.clone().zone(120).minute(), 0, "should get minute correctly");
+
+ test.equal(a.clone().zone(-120).year(), 2012, "should get year correctly");
+ test.equal(a.clone().zone(-120).month(), 0, "should get month correctly");
+ test.equal(a.clone().zone(-120).date(), 1, "should get date correctly");
+ test.equal(a.clone().zone(-120).hour(), 2, "should get hour correctly");
+ test.equal(a.clone().zone(-120).minute(), 0, "should get minute correctly");
+
+ test.equal(a.clone().zone(-90).year(), 2012, "should get year correctly");
+ test.equal(a.clone().zone(-90).month(), 0, "should get month correctly");
+ test.equal(a.clone().zone(-90).date(), 1, "should get date correctly");
+ test.equal(a.clone().zone(-90).hour(), 1, "should get hour correctly");
+ test.equal(a.clone().zone(-90).minute(), 30, "should get minute correctly");
+
+ test.done();
+ },
+
+ "from" : function (test) {
+ var zoneA = moment(),
+ zoneB = moment(zoneA).zone(720),
+ zoneC = moment(zoneA).zone(360),
+ zoneD = moment(zoneA).zone(-690),
+ other = moment(zoneA).add('m', 35);
+
+ test.equal(zoneA.from(other), zoneB.from(other), "moment#from should be the same in all zones");
+ test.equal(zoneA.from(other), zoneC.from(other), "moment#from should be the same in all zones");
+ test.equal(zoneA.from(other), zoneD.from(other), "moment#from should be the same in all zones");
+
+ test.done();
+ },
+
+ "diff" : function (test) {
+ var zoneA = moment(),
+ zoneB = moment(zoneA).zone(720),
+ zoneC = moment(zoneA).zone(360),
+ zoneD = moment(zoneA).zone(-690),
+ other = moment(zoneA).add('m', 35);
+
+ test.equal(zoneA.diff(other), zoneB.diff(other), "moment#diff should be the same in all zones");
+ test.equal(zoneA.diff(other), zoneC.diff(other), "moment#diff should be the same in all zones");
+ test.equal(zoneA.diff(other), zoneD.diff(other), "moment#diff should be the same in all zones");
+
+ test.equal(zoneA.diff(other, 'minute', true), zoneB.diff(other, 'minute', true), "moment#diff should be the same in all zones");
+ test.equal(zoneA.diff(other, 'minute', true), zoneC.diff(other, 'minute', true), "moment#diff should be the same in all zones");
+ test.equal(zoneA.diff(other, 'minute', true), zoneD.diff(other, 'minute', true), "moment#diff should be the same in all zones");
+
+ test.equal(zoneA.diff(other, 'hour', true), zoneB.diff(other, 'hour', true), "moment#diff should be the same in all zones");
+ test.equal(zoneA.diff(other, 'hour', true), zoneC.diff(other, 'hour', true), "moment#diff should be the same in all zones");
+ test.equal(zoneA.diff(other, 'hour', true), zoneD.diff(other, 'hour', true), "moment#diff should be the same in all zones");
+
test.done();
}