From 88df29c186b227dcf070979c229ed823d3152399 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 9 Jun 2021 17:59:59 +0000 Subject: [PATCH] Bug 28538: Insert formatted date if valid This patch restores the setting of the date from bug 27937 and adds a parsing of the date to ensure the correct format To test: 1 - Follow test plan from bug 27937 - it fails 2 - Follow test plan from bug 28351 - it succeeds 3 - Apply patch 4 - Repeat 1-2 5 - both plans pass now --- koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc | 2 +- koha-tmpl/intranet-tmpl/prog/js/calendar.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc index 511a6b88a5..fb90add482 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -60,7 +60,7 @@ Add manual restriction
  1. -
  2. +
  3. Clear date
Cancel
diff --git a/koha-tmpl/intranet-tmpl/prog/js/calendar.js b/koha-tmpl/intranet-tmpl/prog/js/calendar.js index 2b335ec9bc..3ed43219f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/calendar.js +++ b/koha-tmpl/intranet-tmpl/prog/js/calendar.js @@ -193,7 +193,8 @@ $(document).ready(function () { if (!is_valid_date($(this).val())) { $(this).val(""); } else { - $(this).datepicker("setDate",$(this).val()); + var the_date = $.datepicker.parseDate(dateformat_string, $(this).val()); + $(this).datepicker("setDate",the_date); } }); // http://jqueryui.com/demos/datepicker/#date-range -- 2.11.0