[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 16:07:14 CEST 2022


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

Owen Leonard <oleonard at myacpl.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #134615|0                           |1
        is obsolete|                            |

--- Comment #7 from Owen Leonard <oleonard at myacpl.org> ---
Created attachment 134740
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134740&action=edit
Bug 30673: Improve is_valid_date function for validating date strings

This patch corrects a couple of issues with our date validation in both
the staff interface and the OPAC. The "is_valid_date" function needs to
be able to accept a custom date format when one has been defined to
override the default Flatpickr configuration.

The function also needs to do better checking of the date itself
following the transition to Flatpickr. jQueryUI's parse method had
better built-in error handling, whereas Flatpickr's simply tries its
best to convert a string into a date. We can use the existing
Date_from_syspref function to check that the date string can be
converted to a valid JavaScript Date object.

To test, apply the patch and test date input fields in a few places in
the staff interface, e.g. the patron edit form, the circulation
statistics wizard, or the overdues page. Also check these specific
pages:

- With the dateformat system preference set to something other than
  "yyyy-mm-dd" open an item for editing. The "Date acquired" date picker
  should work correctly and fill the date in "yyyy-mm-dd" format
  (overriding the Flatpickr default).
- Check Serial -> Claims to confirm that the "To" and "From" filters
  work correctly.
- Test that various dateformat preference settings work in all cases.

In the OPAC, test that date picker inputs work correctly on pages like
the "Place hold" page, the "Your personal details" page, and "Your
summary" -> "Holds" -> "Suspend."

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


More information about the Koha-bugs mailing list