I checked out an item and it showed the checkout date as: 2023-07-16 12:44:18 Dateformat was set to MM/DD/YYYY. Switching it to DD.MM.YYYY made no difference. Due date displays correctly.
The relevant commit is 1000ab402b from Bug 33804, where the `mDataProp` property of the "Checked out on" column was changed for both the issues and the relatives' issues DataTables from "issuedate_formatted" to plain "issuedate". "issuedate" is retrieved (via svc/checkouts) from the `issues` database table and is a datetime column of the form YYYY-MM-DD HH:MM:SS. This explains the "2023-07-16 12:44:18" checkout date that Katrin observed. "issuedate_formatted" comes from the same DB column, but is formatted using Koha::DateUtils::dt_from_string() which takes into account the `DateFormat` System Preference.
Created attachment 153523 [details] [review] Bug 34292: Format the check out date with dt_from_string() In the current master, checking out an item to a patron results in a 'Checked out on' date of the form '2023-07-16 12:44:18' when viewing the patron's 'Checkouts' table. This is due to commit 1000ab402b from Bug 33804 which changed the `mDataProp` property of the 'Checked out on' column from "issuedate_formatted" to plain "issuedate" (for both the issues and relatives' issues DataTables). "issuedate" comes straight from the issues.issuedate DB column (which has `datetime` format), whereas "issuedate_formatted" is formatted using Koha::DateUtils::dt_from_string() which takes into account the `dateformat` System Preference. This patch restores the original behaviour w.r.t. the formatting of the 'Checked out on' column. Note: in `svc/checkouts` we don't pass `as_due_date => 1` for `issuedate_formatted` because we *do* want to show a check out date with a time component of 23:59. Test plan: 1) Without applying this patch, issue an item to a patron and notice that in the 'Checkouts' table the 'Checked out on' date is of the form YYYY-MM-DD HH:MM:SS. 2) Apply this patch, restart Plack if necessary. 3) Refresh the patron 'Checkouts' table: this time the 'Checked out on' date will observe the setting of your `dateformat` System Preference. 4) Extra credit: repeat step 3) for different `dateformat` settings, each time you should get a 'Checked out on' date that matches the date format you chose.
Created attachment 153524 [details] [review] Bug 34292: Fix typos in JSDoc documentation equivilent -> equivalent koha -> Koha
Created attachment 153526 [details] [review] Bug 34292: (bug 33804 follow-up) Format "checked out on" date
Sorry about that! Thanks Andreas for the patches, however it is not correct to reinsert dt_from_string in the controller, we want to format date client-side. This patch fixes the problem, however we should/could provide more cleaning and remove the "Sort on hidden unformatted issuedate column" related code as well (which could be done on a separate bug if needed).
Thank you for your feedback, Jonathan. I have now obsoleted my patch and only kept the typo-fixing patch. I've also tested your patch and it works fine, so I'm going to sign it off.
Created attachment 153559 [details] [review] Bug 34292: (bug 33804 follow-up) Format "checked out on" date Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Thanks Andreas, could you adjust the status?
(In reply to Jonathan Druart from comment #8) > Thanks Andreas, could you adjust the status? Done! ;-)
Created attachment 154057 [details] [review] Bug 34292: (bug 33804 follow-up) Format "checked out on" date Signed-off-by: Andreas Roussos <a.roussos@dataly.gr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 154058 [details] [review] Bug 34292: (bug 33804 follow-up) Format "checked out on" date Test plan: 1) Without applying this patch, issue an item to a patron and notice that in the 'Checkouts' table the 'Checked out on' date is of the form YYYY-MM-DD HH:MM:SS. 2) Apply this patch, restart Plack if necessary. 3) Refresh the patron 'Checkouts' table: this time the 'Checked out on' date will observe the setting of your `dateformat` System Preference. 4) Extra credit: repeat step 3) for different `dateformat` settings, each time you should get a 'Checked out on' date that matches the date format you chose. Signed-off-by: Andreas Roussos <a.roussos@dataly.gr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.11. Nice work everyone, thanks!
Depends on Bug 33804 not in 23.05.x