From f4cae315940fbda9e2ac2a5f4632861c0615b151 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 15 Oct 2021 09:49:19 +0200 Subject: [PATCH] Bug 29270: Remove flatpickr instantiation from request.tt The JS code is only used when placing a hold for club BUT the date inputs are not displayed there. Test plan: Place holds for patrons and clubs and confirm that the two date inputs are working correctly Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/reserve/request.tt | 33 ++----------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 8e9bf1fd4f..a6d269f71f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -492,15 +492,13 @@ [% IF ( reserve_in_future ) %]
  • - - +
  • [% END %]
  • - - +
  • [% UNLESS ( multi_hold ) %] @@ -1154,29 +1152,6 @@ [% END %] - var startPicker = $("#reserve_date").flatpickr({ - minDate: new Date().fp_incr(1), /* Require that "Hold starts on date" be in the future */ - onChange: function(selectedDates, dateStr, instance) { - altFormat = instance.formatDate(selectedDates[0], "Y-m-d"); - $(".datepickerfrom_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */ - }, - onClose: function( selectedDates, dateText, instance) { - validate_date( selectedDates, instance ); - endPicker.set('minDate', selectedDates[0]); - } - }); - - var endPicker = $("#expiration_date").flatpickr({ - minDate: new Date().fp_incr(1), // Require that "Hold expires on date" be in the future - onChange: function(selectedDates, dateStr, instance) { - altFormat = instance.formatDate(selectedDates[0], "Y-m-d"); - $(".datepickerto_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */ - }, - onClose: function( selectedDates, dateText, instance) { - validate_date( selectedDates, instance ); - }, - }); - var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, { 'bPaginate': false, "sDom": '<"top pager"ilf>t', @@ -1203,10 +1178,6 @@ data.patron_id = $('input[name="borrowernumber"]').val(); if($('textarea[name="notes"]').length) data.notes = $('textarea[name="notes"]').val()||null; - if($('.datepickerto_hidden').length) - data.expiration_date = $('.datepickerto_hidden').val()||null; - if($('.datepickerfrom_hidden').length) - data.hold_date = $('.datepickerfrom_hidden').val()||null; if($('input[name="itemtype"]').length) { data.item_type = $('input[name="itemtype"]').val()||null; } -- 2.39.5