Bugzilla – Attachment 165309 Details for
Bug 33703
Entering dates should be more flexible accepting different entry formats
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33703: Don't use Maskito when picking a range
Bug-33703-Dont-use-Maskito-when-picking-a-range.patch (text/plain), 3.14 KB, created by
Lucas Gass (lukeg)
on 2024-04-22 14:24:00 UTC
(
hide
)
Description:
Bug 33703: Don't use Maskito when picking a range
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-04-22 14:24:00 UTC
Size:
3.14 KB
patch
obsolete
>From 4a1900be8d430530288dfa8c5e5b2d016248d2cd Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 4 Mar 2024 18:05:40 +0000 >Subject: [PATCH] Bug 33703: Don't use Maskito when picking a range > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/includes/calendar.inc | 38 +++++++++++-------- > 1 file changed, 22 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 2edabb3d65..16ec8bcd44 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -85,30 +85,36 @@ > onChange: function( selectedDates, dateText, instance) { > 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)); >+ let accepts_period = $(thisInput).data('flatpickr-period'); >+ if ( !accepts_period ) { >+ if ( accepts_time ) { >+ let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat); >+ if ( !parsedDate.getHours() ) { >+ instance.setDate(selectedDates[0].setHours(23, 59, 0, 0)); >+ } > } > } > }, > onOpen: function( selectedDates, dateText, instance ) { > var thisInput = instance.input; > let accepts_time = $(thisInput).data('flatpickr-enable-time'); >+ let accepts_period = $(thisInput).data('flatpickr-period'); > let options = {}; >- if ( accepts_time ) { >- options = maskitoDateTimeOptionsGenerator({ >- dateMode: altinput_dateformat, >- timeMode: 'HH:MM', >- dateSeparator: delimiter, >- }); >- } else { >- options = maskitoDateOptionsGenerator({ >- mode: altinput_dateformat, >- separator: delimiter, >- }); >+ if ( !accepts_period ) { >+ if ( accepts_time ) { >+ options = maskitoDateTimeOptionsGenerator({ >+ dateMode: altinput_dateformat, >+ timeMode: 'HH:MM', >+ dateSeparator: delimiter, >+ }); >+ } else { >+ options = maskitoDateOptionsGenerator({ >+ mode: altinput_dateformat, >+ separator: delimiter, >+ }); >+ } >+ new Maskito( instance.altInput, options ); > } >- new Maskito( instance.altInput, options ); > }, > onClose: function( selectedDates, dateText, instance) { > validate_date( 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 33703
:
150894
|
150895
|
155719
|
155720
|
155861
|
155862
|
156411
|
156412
|
156413
|
157132
|
157135
|
157206
|
157746
|
161619
|
161663
|
162722
|
162723
|
162724
|
162725
|
162726
|
162727
|
162728
|
162729
|
162730
|
162731
|
163078
|
163079
|
163080
|
163081
|
163082
|
163083
|
163319
|
163320
|
163321
|
163322
|
163323
|
163324
|
163978
|
163979
|
163980
|
163981
|
163982
|
163983
|
165307
|
165308
| 165309 |
165310
|
165311
|
165312
|
165399