You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
648 B
24 lines
648 B
2 years ago
|
/* global describe, it */
|
||
|
|
||
|
var assert = require('assert');
|
||
|
var {timeFormat} = require('app/common/timeFormat');
|
||
|
|
||
|
describe('timeFormat', function() {
|
||
|
|
||
|
var date = new Date(2014, 3, 4, 22, 28, 16, 123);
|
||
|
|
||
|
it("should format date", function() {
|
||
|
assert.equal(timeFormat("Y", date), "20140404");
|
||
|
assert.equal(timeFormat("D", date), "2014-04-04");
|
||
|
});
|
||
|
|
||
|
it("should format time", function() {
|
||
|
assert.equal(timeFormat("T", date), "22:28:16");
|
||
|
assert.equal(timeFormat("T + M", date), "22:28:16 + 123");
|
||
|
});
|
||
|
|
||
|
it("should format date and time", function() {
|
||
|
assert.equal(timeFormat("A", date), "2014-04-04 22:28:16.123");
|
||
|
});
|
||
|
});
|