[Koha-bugs] [Bug 30673] Improve is_valid_date function for validating date strings

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 6 14:33:18 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30673

--- Comment #3 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
1. 
-    var MSG_PLEASE_ENTER_A_VALID_DATE = ( __("Please enter a valid date
(should match %s).") );
+    var MSG_PLEASE_ENTER_A_VALID_DATE = ( _("Please enter a valid date (should
match %s).") );

Only at the OPAC, is that change expected? If so, why not at the intranet?

2. That's ugly. But we could go with this code for a quick fix.
A correct fix would be to switch to dayjs (see bug 30310) and use 
  dayjs('1970-00-00', 'YYYY-MM-DD', true).isValid()

See https://day.js.org/docs/en/parse/string-format
We should not need to deal with that by ourselves.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list