Bug 5549 : Pass time_zone correctly
This commit is contained in:
parent
5b2260ae85
commit
0ce31bfba9
2 changed files with 3 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue