Bug 29402 - We should add a 'dateonly' switch option to dt_from_string
Summary: We should add a 'dateonly' switch option to dt_from_string
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on: 24850
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-03 11:36 UTC by Martin Renvoize
Modified: 2021-11-03 13:10 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2021-11-03 11:36:03 UTC
Currently, our dateformat is only 'strict' with the rfc3339 format.

ISO dates may optionally contain a time portion, but that time portion is incompatible with refc3339 formatted dates.  We should add a dateonly option to dt_from_string so we can explicitly fail if an iso date string is passed with a time element that we should drop due to a failed match.
Comment 1 Martin Renvoize 2021-11-03 13:10:07 UTC
Bug 29403 improves the situation regards date strings with unexpected data prepended/appended.. but it doesn't strictly prevent a valid datetime being accepted when only a date was expected.