We don't need our own JS functions to parse date, we can rely on dayjs for that.
Created attachment 137680 [details] [review] Bug 31149: Use dayjs to parse dates We can use the isValid's dayjs function instead of our own parsing functions. Test plan: Confirm that you cannot enter an invalid date when using a date picker widget.
Created attachment 144680 [details] [review] Bug 31149: Use dayjs to parse dates We can use the isValid's dayjs function instead of our own parsing functions. Test plan: Confirm that you cannot enter an invalid date when using a date picker widget. Works as expected. Signed-off-by: LMSCloudPaulD <paul.derscheid@lmscloud.de>
Created attachment 144733 [details] [review] Bug 31149: Use dayjs to parse dates We can use the isValid's dayjs function instead of our own parsing functions. Test plan: Confirm that you cannot enter an invalid date when using a date picker widget. Works as expected. Signed-off-by: LMSCloudPaulD <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This would be a PQA from me.. but we're blocked so marking as such.
Created attachment 187511 [details] [review] Bug 31149: Use dayjs to parse dates We can use the isValid's dayjs function instead of our own parsing functions. Test plan: Confirm that you cannot enter an invalid date when using a date picker widget. Works as expected. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This one got lost!
It seems like calendar.js is not tidy
Created attachment 187734 [details] [review] Bug 31149: Use dayjs to parse dates We can use the isValid's dayjs function instead of our own parsing functions. Test plan: Confirm that you cannot enter an invalid date when using a date picker widget. Works as expected. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice work everyone! Pushed to main for 25.11
This has broken the ILL list table, if it affects other tables, I don't know. Create an ILL request and visit the table, you get this: Uncaught TypeError: m.tz is not a function at window.$date (ill-requests.pl:1606:23) at render (ill-list-table_25.0600022.js:452:32) at Object._render (datatables.min_25.0600022.js:41:12213) at r.fnGetData (datatables.min_25.0600022.js:41:14938) Reset to the previous commit: git reset --hard 9f2216cf20584079bb3706b4d965d1e91e273016 Refresh, works fine.
Created attachment 187979 [details] [review] Bug 31149: Add dayjs plugins It seems dayjs is now being imported twice? With the second time overriding the first, but without the plugins. This patch "fixes" the issue by proving this, but there is likely a better solution than this copy-paste from js-date-format.inc
follow-up pushed to main
Lucas, please revert this. The code has changed since I originally wrote it. It was wrong to switch it back to SO without fully tested it. I will have another look later, but I don't have time to deal with all the side-effects right now. I suspect the Cypress tests to fail because of this. You can also notice that flatpickr is broken right now ("Please enter a valid date (should match mm/dd/yyyy)") Sorry about that!
Reverted from main
I think this is no longer needed, see bug 41061.