Bugzilla – Attachment 61089 Details for
Bug 9031
Overdue items crossing DST boundary throw invalid local time exception
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9031 - Overdue items crossing DST boundary throw invalid local time exception
Bug-9031---Overdue-items-crossing-DST-boundary-thr.patch (text/plain), 1.40 KB, created by
Nick Clemens (kidclamp)
on 2017-03-14 16:50:56 UTC
(
hide
)
Description:
Bug 9031 - Overdue items crossing DST boundary throw invalid local time exception
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-03-14 16:50:56 UTC
Size:
1.40 KB
patch
obsolete
>From a8ec4f581af20f044e1e8cb9efe4129a508f5c24 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 14 Mar 2017 12:46:28 -0400 >Subject: [PATCH] Bug 9031 - Overdue items crossing DST boundary throw invalid > local time exception > >To test: >1 - Set TZ to America/New York >2 - Checkout item and set due date to '2016-03-09 02:29:00" >3 - Make sure fines are set for the item type, fine mode production, > calculate fines on return >4 - Check in item - invalid date time warning in logs >5 - Apply patch >6 - Check in item - no error >7 - prove t/Calendar.t >--- > Koha/Calendar.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm >index f6cb58c..72f619e 100644 >--- a/Koha/Calendar.pm >+++ b/Koha/Calendar.pm >@@ -311,7 +311,7 @@ sub days_between { > > # start and end should not be closed days > my $days = $start_dt->delta_days($end_dt)->delta_days; >- for (my $dt = $start_dt->clone(); >+ for (my $dt = $start_dt->clone()->set_time_zone('UTC'); > $dt <= $end_dt; > $dt->add(days => 1) > ) { >@@ -335,7 +335,7 @@ sub hours_between { > # take into account open/close times then it would be a duration > # of library open hours > my $skipped_days = 0; >- for (my $dt = $start_dt->clone(); >+ for (my $dt = $start_dt->clone()->set_time_zone('UTC'); > $dt <= $end_dt; > $dt->add(days => 1) > ) { >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9031
:
13714
|
13795
|
61089
|
63718
|
64910
|
64911
|
68575
|
68576
|
68577
|
68578
|
68579
|
68580
|
68581
|
68582