},
calendar : function () {
- var diff = this.diff(moment().startOf('day'), 'days', true),
+ var diff = this.diff(moment().zone(this.zone()).startOf('day'), 'days', true),
format = diff < -6 ? 'sameElse' :
diff < -1 ? 'lastWeek' :
diff < 0 ? 'lastDay' :
test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at !:)) AM", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at @:)) AM", "yesterday at the same time");
+ test.done();
+ },
+
+ "calendar day timezone" : function (test) {
+ test.expect(1);
+
+ var z = 60,
+ a = moment().zone(z).startOf('day').subtract({ m: 1 });
+
+ test.equal(moment(a).zone(z).calendar(), "Yesterday at !!:%( PM", "Yesterday at 11:59 PM");
test.done();
}
};