Bugzilla – Attachment 160830 Details for
Bug 35341
Circulation rule dates are being overwritten
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35341: Do not reinstantiate flatpickr
Bug-35341-Do-not-reinstantiate-flatpickr.patch (text/plain), 2.61 KB, created by
Jonathan Druart
on 2024-01-11 10:56:54 UTC
(
hide
)
Description:
Bug 35341: Do not reinstantiate flatpickr
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-01-11 10:56:54 UTC
Size:
2.61 KB
patch
obsolete
>From 67c00223ff2ff44adbb79540800baf3441d77067 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Jan 2024 11:56:16 +0100 >Subject: [PATCH] Bug 35341: Do not reinstantiate flatpickr > >We do not need to reinstantiate flatpickr, we need to retrieve the >existing instance. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 1 + > .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 8 ++++---- > 2 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index f0275520539..076820873ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -200,6 +200,7 @@ > fp.set("maxDate", now.setMinutes(now.getMinutes() + 1)); > }, 30000); > } >+ return fp; > } > > $(document).ready(function(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 0ad2b55cff5..e3edc701bc4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -1505,16 +1505,16 @@ > } else if ( i == 9 ) { > // specific processing for Hard due date > $(current_column).find("select").val(itm_code); >- if (itm_text) { >+ if (is_valid_date(itm_text)) { > input_values = itm_text.split(' '); >- var fp = $('#hardduedate').flatpickr(); >+ var fp = document.querySelector("#hardduedate")._flatpickr; > var hardduedate = fp.parseDate( input_values[1], flatpickr_dateformat_string ); > if( hardduedate) fp.setDate( hardduedate, 1 ); > } > } else if ( i == 26 ) { > // specific processing for No automatic renewal after (hard limit) >- if (itm_text) { >- var fp = $('#no_auto_renewal_after_hard_limit').flatpickr(); >+ if (is_valid_date(itm_text)) { >+ var fp = document.querySelector("#no_auto_renewal_after_hard_limit")._flatpickr; > var renewdate = fp.parseDate( itm_text, flatpickr_dateformat_string ); > if( renewdate) fp.setDate( renewdate, 1 ); > } >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35341
:
158980
|
159005
|
159077
|
159591
|
159592
|
159669
|
160830
|
160844
|
160845
|
160850
|
160896
|
160928