Bug 33804 - Implement as_due_date for $date (js-date-format)
Summary: Implement as_due_date for $date (js-date-format)
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 33568 34292
  Show dependency treegraph
 
Reported: 2023-05-23 11:01 UTC by Jonathan Druart
Modified: 2023-08-17 19:51 UTC (History)
2 users (show)

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


Attachments
Bug 33804: Add as_due_date option to $date (1.65 KB, patch)
2023-05-23 11:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33804: Use as_due_date to display due dates (6.48 KB, patch)
2023-05-23 11:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33804: Use as_due_date to display due dates (5.57 KB, patch)
2023-05-23 11:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33804: Add as_due_date option to $date (1.71 KB, patch)
2023-05-25 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33804: Use as_due_date to display due dates (5.62 KB, patch)
2023-05-25 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33804: (follow-up) Convert to JSDoc formatted documentation (2.22 KB, patch)
2023-05-25 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33804: Add as_due_date option to $date (1.77 KB, patch)
2023-07-13 16:32 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 33804: Use as_due_date to display due dates (5.67 KB, patch)
2023-07-13 16:32 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 33804: (follow-up) Convert to JSDoc formatted documentation (2.27 KB, patch)
2023-07-13 16:32 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 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.