]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add strict field to creationData
authorIskren Chernev <iskren.chernev@gmail.com>
Sun, 27 Dec 2015 11:53:29 +0000 (13:53 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Tue, 29 Dec 2015 18:12:52 +0000 (20:12 +0200)
src/lib/moment/creation-data.js
src/test/moment/creation-data.js

index 47344131cc5e71848959053637f1e5f53209cc72..7e2d69aa1e34be8cc3ef2393077ffbda12dfbb01 100644 (file)
@@ -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
     };
 }
index a7e75a0a94f7c7b63b5442e07cc1391a781e4c6d..15391462ece918f8a70134e00e95ee6d385b1590 100644 (file)
@@ -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');
+});