Bug 29402

Summary: We should add a 'dateonly' switch option to dt_from_string
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29403
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 24850    
Bug Blocks:    

Description Martin Renvoize (ashimema) 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 (ashimema) 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.