From a133becbfc738dcd327a6422b50e39d95ce1028c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 27 Apr 2015 10:42:51 +0200 Subject: [PATCH] Bug 14060: Display the date format on the warning popup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The date format is now displayed on the warning popup. Signed-off-by: Owen Leonard Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall (cherry picked from commit 2a3966946131992ceeb125be3a852b9893bfd708) Signed-off-by: Frédéric Demians --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 7439304cbe..3c0b8b3fa1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -6,21 +6,25 @@ var debug = "[% debug %]"; var dformat = "[% dateformat %]"; var sentmsg = 0; if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} -var MSG_PLEASE_ENTER_A_VALID_DATE = ("Please enter a valid date."); +var MSG_PLEASE_ENTER_A_VALID_DATE = _("Please enter a valid date (should match %s)."); function validate_date (dateText, inst) { var dateformat = '[% Koha.Preference('dateformat') %]'; + var dateformat_str = dateformat if ( dateformat == 'us' ) { dateformat = 'mm/dd/yy'; + dateformat_str = 'mm/dd/yyyy'; } else if ( dateformat == 'metric' ) { dateformat = 'dd/mm/yy'; + dateformat_str = 'dd/mm/yyyy'; } else if (dateformat == 'iso' ) { dateformat = 'yy-mm-dd'; + dateformat_str = 'yyyy-mm-dd'; } try { $.datepicker.parseDate(dateformat, dateText); } catch (e) { - alert(MSG_PLEASE_ENTER_A_VALID_DATE); + alert(MSG_PLEASE_ENTER_A_VALID_DATE.format(dateformat_str)); $('#'+inst.id).val(''); }; } -- 2.39.5