Bugzilla – Attachment 172449 Details for
Bug 38081
maskitoTimeOptionsGenerator does not properly support 12-hour times in calendar.inc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38081: maskitoTimeOptionsGenerator does not properly support 12-hour times in calendar.inc
Bug-38081-maskitoTimeOptionsGenerator-does-not-pro.patch (text/plain), 2.45 KB, created by
Jonathan Druart
on 2024-10-07 09:43:44 UTC
(
hide
)
Description:
Bug 38081: maskitoTimeOptionsGenerator does not properly support 12-hour times in calendar.inc
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-10-07 09:43:44 UTC
Size:
2.45 KB
patch
obsolete
>From 9cde5150d8ae51564da3649ffe06537a0aa233b0 Mon Sep 17 00:00:00 2001 >From: CJ Lynce <cj.lynce@westlakelibrary.org> >Date: Thu, 3 Oct 2024 18:02:47 +0000 >Subject: [PATCH] Bug 38081: maskitoTimeOptionsGenerator does not properly > support 12-hour times in calendar.inc > >This patch corrects an issue where flatpickr time-only input boxes > boxes were not having their inputs masked (limited) properly > due to maskitoTimeOptionsGenerator not properly supporting > 12-hour time inputs for time-only input boxes. > >To test: >1. Login to the staff intranet. >2. Open Administration->Libraries-> Edit any library. >3. Open your browser's development console (typically via F12) > Verify a 'TypeError' message has been thrown for this page. >4. Type in any text into any of the opening hours > This should be limiting only to properly formatted HH:MM. >5. Apply patch >6. Repeat steps 2-4 > Verify no errors show on your browser's development console. > Verify opening hours entry are limited to proper HH:MM format. >7. Open Administration->System Preferences and change TimeFormat > to 12-hours, Save. >8. Repeat steps 2-4 > Verify opening hours text entry are limited to properly > formatted HH:MM AM/PM (or am/pm) > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 9 ++++++--- > 1 file changed, 6 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 8280be9ba9b..2dbb7d9d1c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -99,9 +99,12 @@ > dateSeparator: delimiter, > overwiteMode: 'replace', > }); >- } else if ( accepts_time_only ) { >- maskitoOptions = maskitoTimeOptionsGenerator({ >- }); >+ } else if ( accepts_time_only ) { >+ maskitoOptions = { >+ [% IF Koha.Preference('TimeFormat') == '12hr' -%] mask: [/\d/, /\d/, ':', /\d/, /\d/, ' ', /(a|A|p|P)/, /(m|M)/] >+ [%- ELSE -%]mask: [/\d/, /\d/, ':', /\d/, /\d/] >+ [%- END %], >+ }; > } else { > maskitoOptions = maskitoDateOptionsGenerator({ > mode: altinput_dateformat, >-- >2.34.1
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 38081
:
172366
|
172449
|
172495