From 0ce31bfba99a428fa071b59dcb279e94cb0bacf8 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Tue, 14 Jun 2011 13:57:44 +0100 Subject: [PATCH] Bug 5549 : Pass time_zone correctly --- C4/Circulation.pm | 3 ++- Koha/DateUtils.pm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index fc05e84924..cfc19168ff 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -51,6 +51,7 @@ use C4::Log; # logaction use Data::Dumper; use Koha::DateUtils; +use Koha::Calendar; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -695,7 +696,7 @@ sub CanBookBeIssued { if ($duedate && ref $duedate ne 'DateTime') { $duedate = dt_from_string($duedate); } - my $now = DateTime->now( timezone => C4::Context->tz() ); + my $now = DateTime->now( time_zone => C4::Context->tz() ); unless ( $duedate ) { my $issuedate = $now->clone(); diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 94ea73126e..06ef7c8ef5 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -80,7 +80,7 @@ s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/; $date_string =~ s/00T/01T/; } } - return DateTime::Format::DateParse->parse_datetime( $date_string, $tz ); + return DateTime::Format::DateParse->parse_datetime( $date_string, $tz->name() ); } return DateTime->now( time_zone => $tz ); -- 2.39.5