[Koha-bugs] [Bug 16376] Koha::Calendar-> is_holiday date truncation creates fatal errors for TZ America/Santiago
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Dec 5 20:00:17 CET 2016
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16376
--- Comment #21 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
I spent a couple hours on this. And now have to leave for Manuel's birthday :-D
So, for the record:
- I narrowed the problem down to the sub days_between. Which is called in the
failing scripts. The only way to reproduce this (in order to create the unit
tests) was:
$ENV{TZ} = $timezone;
use POSIX qw(tzset);
tzset;
my $tz = C4::Context->tz;
my $chile_dt = DateTime->new(
day => 6,
month => 9,
year => 2015,
time_zone => $tz
);
my $now_dt = DateTime->now;
my $branch = $builder->build({ source => 'Branch' })->{branchcode};
my $calendar = Koha::Calendar->new( branchcode => $branch );
my $diff = $calendar->days_between($now_dt,$chile_dt);
Using the other suspected functions didn't trigger the problem
(exception_holidays, etc)[1]. So the problem was correctly highlighted by
David, but I'm not sure what's the best place to fix it. I vote for
days_between.
I'll try to resume tomorrow, and will be glad to hear people's comments,
specially David, that created the patch.
[1] Using truncate didn't raise the problem to me, either.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list