Bugzilla – Attachment 169083 Details for
Bug 37371
Direct input of dates not working when editing only part of a date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37371: Move Maskito instantiation to onReady
Bug-37371-Move-Maskito-instantiation-to-onReady.patch (text/plain), 3.30 KB, created by
Martin Renvoize (ashimema)
on 2024-07-17 14:09:28 UTC
(
hide
)
Description:
Bug 37371: Move Maskito instantiation to onReady
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-17 14:09:28 UTC
Size:
3.30 KB
patch
obsolete
>From 403fdfcd1cd3ca77a83ef0bc6a61949f4ac375d3 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 17 Jul 2024 15:08:58 +0100 >Subject: [PATCH] Bug 37371: Move Maskito instantiation to onReady > >--- > .../prog/en/includes/calendar.inc | 38 +++++++++---------- > 1 file changed, 19 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 3eae704b50b..6dc58c40590 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -85,39 +85,39 @@ > instance.set('allowInput',false); > } > }); >- }, >- onChange: function( selectedDates, dateText, instance) { >- var thisInput = instance.input; >- let accepts_time = $(thisInput).data('flatpickr-enable-time'); >- 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 ) { >+ >+ /* When flatpickr instance is ready, add maskito input mask */ > var thisInput = instance.input; > let accepts_time = $(thisInput).data('flatpickr-enable-time'); > let accepts_period = $(thisInput).data('flatpickr-period'); >- let options = {}; >+ let maskitoOptions = {}; > if ( !accepts_period ) { > if ( accepts_time ) { >- options = maskitoDateTimeOptionsGenerator({ >+ maskitoOptions = maskitoDateTimeOptionsGenerator({ > dateMode: altinput_dateformat, > timeMode: 'HH:MM', > dateSeparator: delimiter, > }); > } else { >- options = maskitoDateOptionsGenerator({ >+ maskitoOptions = maskitoDateOptionsGenerator({ > mode: altinput_dateformat, > separator: delimiter, > }); > } >- new Maskito( instance.altInput, options ); >+ } >+ new Maskito( instance.altInput, maskitoOptions ); >+ }, >+ onChange: function( selectedDates, dateText, instance) { >+ var thisInput = instance.input; >+ let accepts_time = $(thisInput).data('flatpickr-enable-time'); >+ 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)); >+ } >+ } > } > }, > onClose: function( selectedDates, dateText, instance) { >-- >2.45.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 37371
:
169083
|
169085
|
169086
|
169087
|
169088
|
169094
|
169135
|
169136
|
169137
|
169138
|
169151
|
169152
|
169153
|
169154