Bug 25023 - Claims returned dates not formatted according to dateformat preference
Summary: Claims returned dates not formatted according to dateformat preference
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
: 25117 (view as bug list)
Depends on: 14697
Blocks: 35112
  Show dependency treegraph
 
Reported: 2020-03-31 12:31 UTC by Sally
Modified: 2024-07-04 20:40 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.10
Circulation function:


Attachments
Bug 25023: Claims returned dates not formatted according to dateformat preference (3.86 KB, patch)
2023-07-21 13:08 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25023: Claims returned dates not formatted according to dateformat preference (3.93 KB, patch)
2023-08-08 20:22 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 25023: Claims returned dates not formatted according to dateformat preference (3.99 KB, patch)
2023-08-17 11:08 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sally 2020-03-31 12:31:03 UTC
To replicate:

1.  Turn on the Claims Returned feature by setting ClaimReturnedLostValue to 1
2.  Change Koha's date format to UK format by setting DateFormat to dd/mm/yyyy
3.  Check an item out to a patron
4.  Note that the dates in the Check out screen are in UK format - dd/mm/yyyy
5.  Claim the item as returned
6.  Note that in the Claims tab, the date for 'Created on' is in US format mm/dd/yyyy
7.  In the Claims tab, use the Actions button to mark the item as resolved.
8.  Note that the 'Updated on' and 'Resolution' columns both show the date in US format - mm/dd/yyyy
9.  Reload the Check out page for the patron and note that the 'Return claims' column correctly shows the date in UK format - dd/mm/yyyy
Comment 1 Katrin Fischer 2020-04-12 21:49:55 UTC
*** Bug 25117 has been marked as a duplicate of this bug. ***
Comment 2 Katrin Fischer 2020-04-12 21:51:19 UTC
bug 24999 took care of the checkouts tab, problems on claims tab remain:

To test:
- Create several claims for items checked out by a patron
- Resolve one of them
- Switch dateformat preference and verify the dates updated, created and resolved, don't display correctly
Comment 3 Owen Leonard 2023-07-21 13:08:29 UTC
Created attachment 153783 [details] [review]
Bug 25023: Claims returned dates not formatted according to dateformat preference

This patch updates the code for rendering the claims returned table on
the checkout and patron detail pages. Now the dates are formatted using
the global js-date-format.inc code.

To test, apply the patch and make sure the claims returned feature is
enabled by setting a value in the ClaimReturnedLostValue system
preference.

- Check out some items to a patron.
- Under the checkouts tab, mark several checkouts as "Claim returned."
- Open the claims tab.
- The dates in the "Created on" column should be formatted according to
  your dateformat system preference.
  - Change the dateformat preference and return to the checkouts page.
    Confirm that the claims tab shows dates formatted correctly.
- The "created on" and "updated on" columns should sort correctly with
  any dateformat setting. You may have to directly modify the dates in
  the database in order to have the right data for testing this.
Comment 4 Caroline Cyr La Rose 2023-08-08 20:22:58 UTC
Created attachment 154321 [details] [review]
Bug 25023: Claims returned dates not formatted according to dateformat preference

This patch updates the code for rendering the claims returned table on
the checkout and patron detail pages. Now the dates are formatted using
the global js-date-format.inc code.

To test, apply the patch and make sure the claims returned feature is
enabled by setting a value in the ClaimReturnedLostValue system
preference.

- Check out some items to a patron.
- Under the checkouts tab, mark several checkouts as "Claim returned."
- Open the claims tab.
- The dates in the "Created on" column should be formatted according to
  your dateformat system preference.
  - Change the dateformat preference and return to the checkouts page.
    Confirm that the claims tab shows dates formatted correctly.
- The "created on" and "updated on" columns should sort correctly with
  any dateformat setting. You may have to directly modify the dates in
  the database in order to have the right data for testing this.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 5 Victor Grousset/tuxayo 2023-08-16 06:54:42 UTC
I'm not enough knowledgeable with the JS part to review it but about the template:
why do we need a duplication of the lines with return-claim-created-on and return-claim-updated-on?

It's definitely related to
```
                        "mDataProp": "created_on",
                        "bVisible": false,
```
and it's counterpart for updated-on.
And without the duplication in the template, the table breaks.
Comment 6 Owen Leonard 2023-08-16 09:03:34 UTC
(In reply to Victor Grousset/tuxayo from comment #5)

> why do we need a duplication of the lines with return-claim-created-on and
> return-claim-updated-on?

Each date column has a corresponding hidden column which contains the unformatted date which is used when sorting by that date. In the visible column we see the formatted date.
Comment 7 Victor Grousset/tuxayo 2023-08-17 02:11:13 UTC
Oh okay :o No problem then.
Crazy that it's identical and relies on position for which one to do what.
Comment 8 Martin Renvoize (ashimema) 2023-08-17 11:08:02 UTC
Created attachment 154532 [details] [review]
Bug 25023: Claims returned dates not formatted according to dateformat preference

This patch updates the code for rendering the claims returned table on
the checkout and patron detail pages. Now the dates are formatted using
the global js-date-format.inc code.

To test, apply the patch and make sure the claims returned feature is
enabled by setting a value in the ClaimReturnedLostValue system
preference.

- Check out some items to a patron.
- Under the checkouts tab, mark several checkouts as "Claim returned."
- Open the claims tab.
- The dates in the "Created on" column should be formatted according to
  your dateformat system preference.
  - Change the dateformat preference and return to the checkouts page.
    Confirm that the claims tab shows dates formatted correctly.
- The "created on" and "updated on" columns should sort correctly with
  any dateformat setting. You may have to directly modify the dates in
  the database in order to have the right data for testing this.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2023-08-17 11:09:01 UTC
All working as expected.  I was surprised this wasn't an ajax table yet using the wrapper.. it would be nice to convert it at some point, then this column fun could go away as sorting works more clearly for those I believe.

Passing QA
Comment 10 Tomás Cohen Arazi (tcohen) 2023-08-29 17:35:58 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 11 Fridolin Somers 2023-08-30 06:57:42 UTC
Pushed to 23.05.x for 23.05.04
Comment 12 Matt Blenkinsop 2023-08-31 10:24:08 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x
Comment 13 Aleisha Amohia 2023-10-20 00:48:46 UTC
This patch has created formatting and JS errors for the return claims on 22.11.10. Should we revert the patch on 22.11.x and I can attach a new patch for that branch? Or should I write a follow-up patch for 22.11.x?
Comment 14 Aleisha Amohia 2023-10-20 01:06:38 UTC
Decided to attach the fix for 22.11.x to Bug 35112 so this commit won't need to be reverted.