Bugzilla – Attachment 156753 Details for
Bug 35014
Times should only be set for enable-time flatpickrs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35014: Only set time for enable-time flatpickr
Bug-35014-Only-set-time-for-enable-time-flatpickr.patch (text/plain), 1.66 KB, created by
Lucas Gass (lukeg)
on 2023-10-09 16:01:08 UTC
(
hide
)
Description:
Bug 35014: Only set time for enable-time flatpickr
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-10-09 16:01:08 UTC
Size:
1.66 KB
patch
obsolete
>From fa0231bf17137eb8a0618ad29a681d263cb6d21e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 9 Oct 2023 16:37:22 +0100 >Subject: [PATCH] Bug 35014: Only set time for enable-time flatpickr > >This patch adds a check to the onChange function such that we only >attempt to set the default time on change for time enabled flatpickrs >when the date is entered manually. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index d189c1deaed..f0275520539 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -71,9 +71,13 @@ > }); > }, > onChange: function( selectedDates, dateText, instance) { >- let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat); >- if ( !parsedDate.getHours() ) { >- instance.setDate(selectedDates[0].setHours(23, 59, 0, 0)); >+ var thisInput = instance.input; >+ let = accepts_time = $(thisInput).data('flatpickr-enable-time'); >+ if ( accepts_time ) { >+ let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat); >+ if ( !parsedDate.getHours() ) { >+ instance.setDate(selectedDates[0].setHours(23, 59, 0, 0)); >+ } > } > }, > onClose: function( selectedDates, dateText, instance) { >-- >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 35014
:
156750
|
156753
|
156767