From eddbed031389b302b1f2484296fd2cbb975e7bf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 18 Oct 2017 13:53:40 +0200 Subject: [PATCH] =?utf8?q?kivi.Validator:=20Spezialbehandlung=20von=200=20?= =?utf8?q?f=C3=BCr=20heute=20wieder=20hergestellt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/kivi.js | 3 +++ js/t/kivi/parse_format_date.js | 1 + 2 files changed, 4 insertions(+) diff --git a/js/kivi.js b/js/kivi.js index 7e8bc90ea..daedfaa78 100644 --- a/js/kivi.js +++ b/js/kivi.js @@ -37,6 +37,9 @@ namespace("kivi", function(ns) { if (date === '') return null; + if (date === '0') + return new Date(); + var parts = date.replace(/\s+/g, "").split(ns._date_format.sep); var today = new Date(); diff --git a/js/t/kivi/parse_format_date.js b/js/t/kivi/parse_format_date.js index 51a39d056..904142d88 100644 --- a/js/t/kivi/parse_format_date.js +++ b/js/t/kivi/parse_format_date.js @@ -23,6 +23,7 @@ QUnit.test("kivi.parse_date function for German date style with dots", function( assert.deepEqual(kivi.parse_date(":"), undefined); assert.deepEqual(kivi.parse_date("::"), undefined); assert.deepEqual(kivi.parse_date(""), null); + assert.deepEqual(kivi.parse_date("0"), new Date()); }); QUnit.test("kivi.parse_date function for German date style with slashes", function( assert ) { -- 2.20.1