Bugzilla – Attachment 156309 Details for
Bug 34939
When manually entering dates in flatPickr the hour and minute get set to 00:00 not 23:59
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set
Bug-34939-Set-hourminute-to-2359-when-inputing-dat.patch (text/plain), 2.00 KB, created by
Lucas Gass (lukeg)
on 2023-09-27 21:27:12 UTC
(
hide
)
Description:
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-09-27 21:27:12 UTC
Size:
2.00 KB
patch
obsolete
>From 65ef9228876f36faf39946941d86db3f1fdcf4d7 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 27 Sep 2023 21:22:43 +0000 >Subject: [PATCH] Bug 34939: Set hour:minute to 23:59 when inputing dates > unless explicitly set > >1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt >2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023 >3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr >4. Apply patch, clear browser cache. >5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59. >6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22. >7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM. >8. Play with this in as many TimeFormat and DateFormat combonatinons as you can. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 5606e9956e..07f5bc8045 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -70,6 +70,12 @@ > } > }); > }, >+ onChange: function( selectedDates, dateText, instance) { >+ let parsedDate = flatpickr.parseDate(dateText, instance.config.dateFormat); >+ if ( parsedDate.getHours() === 0 ) { >+ instance.setDate(selectedDates[0].setHours(23, 59, 0, 0)); >+ } >+ }, > onClose: function( selectedDates, dateText, instance) { > validate_date( dateText, instance ); > var thisInput = instance.input; >-- >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 34939
:
156309
|
156311
|
156405
|
156461
|
156495