moment-timezone
Version:
Timezone plugin for Moment.js.
14 lines (10 loc) • 723 B
JavaScript
var moment = require("../../index");
exports["America/Panama"] = {
"1908" : function (t) {
t.equal(moment("1908-04-22T05:19:35+00:00").tz("America/Panama").format("HH:mm:ss"), "23:59:59", "1908-04-22T05:19:35+00:00 should be 23:59:59 CMT");
t.equal(moment("1908-04-22T05:19:36+00:00").tz("America/Panama").format("HH:mm:ss"), "00:19:36", "1908-04-22T05:19:36+00:00 should be 00:19:36 EST");
t.equal(moment("1908-04-22T05:19:35+00:00").tz("America/Panama").zone(), 19176 / 60, "1908-04-22T05:19:35+00:00 should be 19176 / 60 minutes offset in CMT");
t.equal(moment("1908-04-22T05:19:36+00:00").tz("America/Panama").zone(), 300, "1908-04-22T05:19:36+00:00 should be 300 minutes offset in EST");
t.done();
}
};