From: Sven Schöling Date: Wed, 18 Oct 2017 11:53:40 +0000 (+0200) Subject: kivi.Validator: Spezialbehandlung von 0 für heute wieder hergestellt X-Git-Tag: release-3.5.4~673 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=eddbed031389b302b1f2484296fd2cbb975e7bf1;p=kivitendo-erp.git kivi.Validator: Spezialbehandlung von 0 für heute wieder hergestellt --- 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 ) {