From e1ff477222038aa9a3aee3b0c0effc3332fe9255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 16 Feb 2016 18:33:01 +0100 Subject: [PATCH] misc: fix invalid date check to work with start/end dates (#10004) --- wcs/qommon/static/js/bootstrap-datetimepicker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcs/qommon/static/js/bootstrap-datetimepicker.js b/wcs/qommon/static/js/bootstrap-datetimepicker.js index d528581..144e06d 100644 --- a/wcs/qommon/static/js/bootstrap-datetimepicker.js +++ b/wcs/qommon/static/js/bootstrap-datetimepicker.js @@ -1206,9 +1206,6 @@ d: function(d,v){ return d.setUTCDate(v); } }, val, filtered, part; - if (date.toString() === new Date(0, 0, 0, 0, 0, 0).toString()) { - return null; - } setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; setters_map['dd'] = setters_map['d']; date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()); @@ -1244,6 +1241,9 @@ setters_map[s](date, parsed[s]) } } + if (date.toString() === new UTCDate(0, 0, 0, 0, 0, 0).toString()) { + return null; + } return date; }, formatDate: function(date, format, language, type){ -- 2.7.0