2017-04-30 04:54:41 +00:00
|
|
|
/* vim: set ts=2: */
|
|
|
|
/*jshint loopfunc:true, mocha:true, node:true */
|
|
|
|
var SSF = require('../');
|
2018-02-21 03:35:31 +00:00
|
|
|
var assert = require('assert');
|
2017-04-30 04:54:41 +00:00
|
|
|
describe('dateNF override', function() {
|
|
|
|
it('should override format code 14', function() {
|
|
|
|
assert.equal(SSF.format(14, 43880), "2/19/20");
|
|
|
|
assert.equal(SSF.format(14, 43880, {dateNF:"yyyy-mm-dd"}), "2020-02-19");
|
|
|
|
assert.equal(SSF.format(14, 43880, {dateNF:"dd/mm/yyyy"}), "19/02/2020");
|
|
|
|
});
|
|
|
|
it('should override format "m/d/yy"', function() {
|
|
|
|
assert.equal(SSF.format('m/d/yy', 43880), "2/19/20");
|
|
|
|
assert.equal(SSF.format('m/d/yy', 43880, {dateNF:"yyyy-mm-dd"}), "2020-02-19");
|
|
|
|
assert.equal(SSF.format('m/d/yy', 43880, {dateNF:"dd/mm/yyyy"}), "19/02/2020");
|
|
|
|
});
|
|
|
|
});
|