Bug 33804

Summary: Implement as_due_date for $date (js-date-format)
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34292
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Bug Depends on:    
Bug Blocks: 33568, 34292    
Attachments: Bug 33804: Add as_due_date option to $date
Bug 33804: Use as_due_date to display due dates
Bug 33804: Use as_due_date to display due dates
Bug 33804: Add as_due_date option to $date
Bug 33804: Use as_due_date to display due dates
Bug 33804: (follow-up) Convert to JSDoc formatted documentation
Bug 33804: Add as_due_date option to $date
Bug 33804: Use as_due_date to display due dates
Bug 33804: (follow-up) Convert to JSDoc formatted documentation

Description Jonathan Druart 2023-05-23 11:01:06 UTC

    
Comment 1 Jonathan Druart 2023-05-23 11:02:07 UTC
Created attachment 151559 [details] [review]
Bug 33804: Add as_due_date option to $date
Comment 2 Jonathan Druart 2023-05-23 11:02:10 UTC
Created attachment 151560 [details] [review]
Bug 33804: Use as_due_date to display due dates
Comment 3 Jonathan Druart 2023-05-23 11:03:37 UTC
Still working on this.
We should pass no_tz_adjust to tell dayjs to not adjust the date. We want to display the value from the DB (otherwise 23:59 will be displayed 21:59).

We don't deal with datetime correctly, hence the confusion everywhere...
Comment 4 Jonathan Druart 2023-05-23 11:05:42 UTC
Created attachment 151561 [details] [review]
Bug 33804: Use as_due_date to display due dates
Comment 5 Jonathan Druart 2023-05-23 11:13:06 UTC
See bug 33568 for another example, where we don't need no_tz_adjust. The value is coming from the REST API.
Comment 6 Jonathan Druart 2023-05-23 13:57:39 UTC
I think this is working correctly, but it seems that we could clean and remove some of the columns in checkouts.js (so maybe move the second patch to its own bug report).
Comment 7 Jonathan Druart 2023-05-25 09:49:03 UTC
Test plan:
Confirm that the datetimes are correctly displayed on the checkouts table
Apply 33568 (or use the remote branch)
Confirm that the datetimes are correct on the items table (you need checked out items, with and without the time part 23:59)
Comment 8 Martin Renvoize 2023-05-25 10:57:54 UTC
Created attachment 151666 [details] [review]
Bug 33804: Add as_due_date option to $date

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2023-05-25 10:57:57 UTC
Created attachment 151667 [details] [review]
Bug 33804: Use as_due_date to display due dates

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2023-05-25 10:57:59 UTC
Created attachment 151668 [details] [review]
Bug 33804: (follow-up) Convert to JSDoc formatted documentation
Comment 11 Martin Renvoize 2023-05-25 10:58:59 UTC
Our date handling still confuses me.. but I think this all appears to be correct.

Signing off
Comment 12 Marcel de Rooy 2023-06-23 07:39:45 UTC
This feels like an enh? Am I correct?
Comment 13 Jonathan Druart 2023-07-04 15:11:57 UTC
(In reply to Marcel de Rooy from comment #12)
> This feels like an enh? Am I correct?

Yes, adjusted.
Comment 14 Nick Clemens (kidclamp) 2023-07-13 16:32:20 UTC
Created attachment 153418 [details] [review]
Bug 33804: Add as_due_date option to $date

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens (kidclamp) 2023-07-13 16:32:22 UTC
Created attachment 153419 [details] [review]
Bug 33804: Use as_due_date to display due dates

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Nick Clemens (kidclamp) 2023-07-13 16:32:24 UTC
Created attachment 153420 [details] [review]
Bug 33804: (follow-up) Convert to JSDoc formatted documentation

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Tomás Cohen Arazi 2023-07-14 12:01:12 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 18 Martin Renvoize 2023-07-18 11:37:26 UTC
Not required for anything in 23.05.x series as yet.. leaving the door open for a future backport as required but not backporting for now.