From f723c33d480dbd1883fa32dc85e6cc0bd8a5c0a0 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 17 Jul 2024 14:58:14 +0000 Subject: [PATCH] Bug 37371: Move Maskito init to onReady in dateaccessioned.pl Signed-off-by: Owen Leonard Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- cataloguing/value_builder/dateaccessioned.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl index f9a7bd8758..65c806b29c 100755 --- a/cataloguing/value_builder/dateaccessioned.pl +++ b/cataloguing/value_builder/dateaccessioned.pl @@ -41,15 +41,19 @@ my $builder = sub { \$(document).ready(function(){ \$("#$function_name").flatpickr({ - onOpen: function(selectedDates, dateStr, instance) { + onReady: function(selectedDates, dateStr, instance) { let options = maskitoDateOptionsGenerator({ mode: altinput_dateformat, separator: delimiter, + overwriteMode: 'replace', }); + + new Maskito( instance.altInput, options ); + }, + onOpen: function(selectedDates, dateStr, instance) { if (dateStr == '') { instance.setDate(new Date()); } - new Maskito( instance.altInput, options ); } }); }); -- 2.39.5