From 728c75c833535f9a7630e783896af37f2d12e06c Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 4 Mar 2024 18:39:35 +0000 Subject: [PATCH] Bug 33703: Add Maskito support for OPAC Signed-off-by: Martin Renvoize Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer --- .../bootstrap/en/includes/calendar.inc | 21 + .../opac-tmpl/lib/maskito/maskito.core.js | 662 +++++++ .../opac-tmpl/lib/maskito/maskito.kit.js | 1608 +++++++++++++++++ 3 files changed, 2291 insertions(+) create mode 100644 koha-tmpl/opac-tmpl/lib/maskito/maskito.core.js create mode 100644 koha-tmpl/opac-tmpl/lib/maskito/maskito.kit.js diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc index e35701b81a..f2fafa95d1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc @@ -19,18 +19,28 @@ var flatpickr_timeformat_string = [% IF Koha.Preference('TimeFormat') == '12hr' %]"G:i K"[% ELSE %]"H:i"[% END %]; var flatpickr_timeformat = [% IF Koha.Preference('TimeFormat') == '12hr' %]false[% ELSE %]true[% END %]; var flatpickr_dateformat_string = ""; + var delimter = ""; + var altinput_dateformat = ""; switch ( dateformat_pref ){ case "us": flatpickr_dateformat_string = "m/d/Y"; + altinput_dateformat = 'mm/dd/yyyy'; + delimiter = "/"; break; case "metric": flatpickr_dateformat_string = "d/m/Y"; + altinput_dateformat = 'dd/mm/yyyy'; + delimiter = "/"; break; case "dmydot": flatpickr_dateformat_string = "d.m.Y"; + altinput_dateformat = 'dd/mm/yyyy'; + delimiter = "."; break; default: flatpickr_dateformat_string = "Y-m-d"; + altinput_dateformat = 'yyyy/mm/dd'; + delimiter = "-"; } function get_dateformat_str(dateformat) { @@ -48,6 +58,8 @@ } [% Asset.js("lib/flatpickr/flatpickr.min.js") | $raw %] +[% Asset.js("lib/maskito/maskito.core.js") | $raw %] +[% Asset.js("lib/maskito/maskito.kit.js") | $raw %]