Bugzilla – Attachment 160845 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.85 KB, created by
Marcel de Rooy
on 2024-01-11 13:07:50 UTC
(
hide
)
Description:
Bug 35341: Do not reinstantiate flatpickr
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-01-11 13:07:50 UTC
Size:
2.85 KB
patch
obsolete
>From 10eeda7be486295c4dd42fa736480271d4e7dd00 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 >Content-Type: text/plain; charset=utf-8 > >We do not need to reinstantiate flatpickr, we need to retrieve the >existing instance. > >Test plan: >See previous patch. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../intranet-tmpl/prog/en/includes/calendar.inc | 1 + > .../prog/en/modules/admin/smart-rules.tt | 12 +++++++----- > 2 files changed, 8 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index f027552053..076820873b 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 0ad2b55cff..f3c57ad25e 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 >@@ -1507,14 +1507,16 @@ > $(current_column).find("select").val(itm_code); > if (itm_text) { > input_values = itm_text.split(' '); >- var fp = $('#hardduedate').flatpickr(); >- var hardduedate = fp.parseDate( input_values[1], flatpickr_dateformat_string ); >- if( hardduedate) fp.setDate( hardduedate, 1 ); >+ var fp = document.querySelector("#hardduedate")._flatpickr; >+ if (is_valid_date(input_values[1])) { >+ 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.30.2
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