Bugzilla – Attachment 156750 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.60 KB, created by
Martin Renvoize (ashimema)
on 2023-10-09 15:38:33 UTC
(
hide
)
Description:
Bug 35014: Only set time for enable-time flatpickr
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-09 15:38:33 UTC
Size:
1.60 KB
patch
obsolete
>From 491e49d55418181ff1bf25f4dc96c92549618394 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. >--- > 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.41.0
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