Bugzilla – Attachment 13795 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
Bug-9031.patch (text/plain), 1.33 KB, created by
RG
on 2012-11-30 00:25:38 UTC
(
hide
)
Description:
Bug 9031
Filename:
MIME Type:
Creator:
RG
Created:
2012-11-30 00:25:38 UTC
Size:
1.33 KB
patch
obsolete
>From 588a40a14fb7e33229e07f8260b73532aa7ddd67 Mon Sep 17 00:00:00 2001 >From: Robson Galluci <robsongalluci@gmail.com> >Date: Tue, 27 Nov 2012 20:04:06 -0200 >Subject: [PATCH] Bug 9031 - Overdue items crossing DST boundary throw invalid local time exception > >This patch converts $start_dt and $end_dt to UTC before performing the calculation of the number of days between due date and actual check in date. >--- > Koha/Calendar.pm | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > >diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm >index 90069b6..7075c49 100644 >--- a/Koha/Calendar.pm >+++ b/Koha/Calendar.pm >@@ -241,6 +241,8 @@ sub days_between { > my $start_dt = shift; > my $end_dt = shift; > >+ $start_dt->set_time_zone('UTC'); >+ $end_dt->set_time_zone('UTC'); > > # start and end should not be closed days > my $days = $start_dt->delta_days($end_dt)->delta_days; >@@ -263,6 +265,10 @@ sub hours_between { > my $duration = $end_dt->delta_ms($start_dt); > $start_dt->truncate( to => 'day' ); > $end_dt->truncate( to => 'day' ); >+ >+ $start_dt->set_time_zone('UTC'); >+ $end_dt->set_time_zone('UTC'); >+ > # NB this is a kludge in that it assumes all days are 24 hours > # However for hourly loans the logic should be expanded to > # take into account open/close times then it would be a duration >-- >1.7.2.5 >
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