Sha256: 881a783b2cffaba0a3595241333da22494e88797532a806d3ac1eeaab61b2ae1
Contents?: true
Size: 1.25 KB
Versions: 19
Compression:
Stored size: 1.25 KB
Contents
import { module, test } from '../qunit'; import moment from '../../moment'; module('creation data'); test('valid date', function (assert) { var dat = moment('1992-10-22'), orig = dat.creationData(); assert.equal(dat.isValid(), true, '1992-10-22 is valid'); assert.equal(orig.input, '1992-10-22', 'original input is not correct.'); assert.equal(orig.format, 'YYYY-MM-DD', 'original format is defined.'); assert.equal(orig.locale._abbr, 'en', 'default locale is en'); assert.equal(orig.isUTC, false, 'not a UTC date'); }); test('valid date at fr locale', function (assert) { var dat = moment('1992-10-22', 'YYYY-MM-DD', 'fr'), orig = dat.creationData(); assert.equal(orig.locale._abbr, 'fr', 'locale is fr'); }); test('valid date with formats', function (assert) { var dat = moment('29-06-1995', ['MM-DD-YYYY', 'DD-MM', 'DD-MM-YYYY']), orig = dat.creationData(); assert.equal(orig.format, 'DD-MM-YYYY', 'DD-MM-YYYY format is defined.'); }); test('strict', function (assert) { assert.ok( moment('2015-01-02', 'YYYY-MM-DD', true).creationData().strict, 'strict is true' ); assert.ok( !moment('2015-01-02', 'YYYY-MM-DD').creationData().strict, 'strict is true' ); });
Version data entries
19 entries across 19 versions & 1 rubygems