From 61d819caef44700b2b1a85c9c27e47913a165a4f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Sep 2016 09:16:02 +0100 Subject: [PATCH] Bug 14060: Consider an empty string as a valid date Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 14ec21d222..7175df2a8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -9,6 +9,9 @@ if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug var MSG_PLEASE_ENTER_A_VALID_DATE = _("Please enter a valid date (should match %s)."); function is_valid_date(date) { + // An empty string is considered as a valid date for convenient reasons. + if ( date === '' ) return 1; + var dateformat = dateformat_str = '[% Koha.Preference('dateformat') %]'; if ( dateformat == 'us' ) { if ( date.search(/\d{2}\/\d{2}\/\d{4}/) == -1 ) return 0; -- 2.39.5