Bug 14016

Summary: Due dates in OPAC show 0:00 when it should be 23:59
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: chris, jonathan.druart, tomascohen
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17299
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13601    
Bug Blocks:    
Attachments: Bug 14016: Restore correct date format on issue date (00:00 vs 23:59)
Bug 14016: Restore correct date format on issue date (00:00 vs 23:59)
[PASSED QA] Bug 14016: Restore correct date format on issue date (00:00 vs 23:59)
Bug 14016: (follow-up) Restore correct date format on issue date (00:00 vs 23:59)
[PASSED QA] Bug 14016: (follow-up) Restore correct date format on issue date (00:00 vs 23:59)

Description Katrin Fischer 2015-04-19 21:49:19 UTC
The due dates on the checkouts tab in the patron account in the OPAC currently show as 04/08/2015 00:00 when the due date is actually 23:59.

Staff and database are correct.
Comment 1 Jonathan Druart 2015-04-20 09:03:03 UTC Comment hidden (obsolete)
Comment 2 Nicolas Legrand 2015-04-20 15:11:26 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-04-20 19:50:50 UTC
Going to pass this patch as it fixes the checkouts tab, but the problem is still visible on the overdues tab - repeat test plan, but check out an item with a due date in the past, so that you get an overdues tab in the patron account.
Comment 4 Katrin Fischer 2015-04-20 19:51:26 UTC
Created attachment 38210 [details] [review]
[PASSED QA] Bug 14016: Restore correct date format on issue date (00:00 vs 23:59)

Introduced by bug 13601, and same fix used in bug 10423 and bug 12847:
the date_due retrieved from the DB is modified.

There are some problems:
1/ There is confusion between the iso and sql formats in the codebase.
2/ Since bug 13601, dt_from_string does not manage the iso format (there
are occurrences of 'iso' but it assumes that both formats are
identical).

To solve the issue, 2 solutions:
1/ Same as bug 10423 and bug 12847: try to get rid of the change done on
date_due in C4::Members::GetPendingIssues, it should be kept as the sql
value.
2/ Too many errors found and another fallback should be added to
dt_from_string (if 'iso' is passed, try sql then iso).

Test plan:
Go on the checkout list at the OPAC and confirm that the due dates are
correctly formatted.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2015-04-21 08:45:33 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-04-21 08:46:04 UTC
(In reply to Katrin Fischer from comment #3)
> Going to pass this patch as it fixes the checkouts tab, but the problem is
> still visible on the overdues tab - repeat test plan, but check out an item
> with a due date in the past, so that you get an overdues tab in the patron
> account.

Yep, see last patch.
It should be corrected in the same patchset.
Comment 7 Katrin Fischer 2015-04-21 20:14:29 UTC
Created attachment 38292 [details] [review]
[PASSED QA] Bug 14016: (follow-up) Restore correct date format on issue date (00:00 vs 23:59)

Same for the overdues.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi 2015-04-23 15:13:38 UTC
Patches pushed to master.

Thanks Jonathan!
Comment 9 Chris Cormack 2015-05-11 21:41:04 UTC
Pushed to 3.18.x will be in 3.18.7