@@ -, +, @@ dateaccessioned.pl --- cataloguing/value_builder/dateaccessioned.pl | 21 -------------------- 1 file changed, 21 deletions(-) --- a/cataloguing/value_builder/dateaccessioned.pl +++ a/cataloguing/value_builder/dateaccessioned.pl @@ -41,28 +41,7 @@ my $builder = sub { altInputClass: "input_marceditor flatpickr-input", dateFormat: "Y-m-d" }); - /* Set current date on page load */ - set_to_today($function_name.id); }); - -function Focus$function_name(event) { - set_to_today(event.data.id); -} - -function Click$function_name(event) { - event.preventDefault(); - set_to_today(event.data.id, 1); -} - -function set_to_today( id, force ) { - /* The force parameter is used in Click but not in Focus ! */ - if (! id) { alert(_("Bad id ") + id + _(" sent to set_to_today()")); return 0; } - var elt = document.querySelector("#" + id); - if ( elt.value == '' || force ) { - const fp = document.querySelector("#" + id)._flatpickr; - fp.setDate(new Date()); - } -} END_OF_JS return $res; --