From: Iskren Chernev Date: Sun, 27 Dec 2015 11:53:29 +0000 (+0200) Subject: Add strict field to creationData X-Git-Tag: 2.11.0~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cd0486b40889ceea301c24f660888fcc09ee295;p=thirdparty%2Fmoment.git Add strict field to creationData --- diff --git a/src/lib/moment/creation-data.js b/src/lib/moment/creation-data.js index 47344131c..7e2d69aa1 100644 --- a/src/lib/moment/creation-data.js +++ b/src/lib/moment/creation-data.js @@ -3,6 +3,7 @@ export function creationData() { input: this._i, format: this._f, locale: this._locale, - isUTC: this._isUTC + isUTC: this._isUTC, + strict: this._strict }; } diff --git a/src/test/moment/creation-data.js b/src/test/moment/creation-data.js index a7e75a0a9..15391462e 100644 --- a/src/test/moment/creation-data.js +++ b/src/test/moment/creation-data.js @@ -27,3 +27,8 @@ test('valid date with formats', function (assert) { 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'); +});