| Summary: | Koha::Calendar::is_holiday truncates the date | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Maxime Pelletier <pelletiermaxime> |
| Component: | Circulation | Assignee: | Maxime Pelletier <pelletiermaxime> |
| Status: | CLOSED FIXED | QA Contact: | Paul Poulain <paul.poulain> |
| Severity: | critical | ||
| Priority: | P5 - low | CC: | chris, dcook, gmcharlt, kyle, paul.poulain, tomascohen |
| Version: | 3.8 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8882 http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9041 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16376 |
||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | Sponsored | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
patch to fix the bug and a test
Patch with a comment in the test to see this bug Bug 8966 Koha::Calendar::is_holiday truncates the date |
||
|
Description
Maxime Pelletier
2012-10-24 21:26:31 UTC
Created attachment 13027 [details] [review] patch to fix the bug and a test Created attachment 13028 [details] [review] Patch with a comment in the test to see this bug Forgot to mention that this is sponsored by CCSR. Created attachment 13068 [details] [review] Bug 8966 Koha::Calendar::is_holiday truncates the date * Create a local copy of the date instead of calling truncate directly on the date * Add a test to properly test that the issue is fixed Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> QA comment: * thanks for the updated Calendar.t, it helped me understand what the patch was fixing * small patch, add a test ++ * passes koha-qa.pl * prove t/Calendar.t => All tests successful. passed QA Patch pushed to master Pushed to 3.8.x, will be in 3.8.7 I just noticed that the Calendar.t uses a DateTime object with a timezone of Europe/London.
If we change the test to include the following,
my $dt = DateTime->new(
month => 9,
year => 2015,
day => 6,
hour => 12,
minute => 00,
second => 00,
time_zone => 'America/Santiago',
);
my $calendar = Koha::Calendar->new(branchcode => "MAIN");
$calendar->is_holiday($dt);
We'll get a fatal error with the following message:
Invalid local time for date in time zone: America/Santiago
See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16376
|