Summary: | Koha::Calendar dies on invalid datetimes during addDuration() | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Circulation | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, kyle.m.hall |
Version: | 23.11 | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
David Cook
2024-10-01 03:40:50 UTC
There is a HardDueDate which I think will be fetched with Australia/Sydney timezone... but with 00:00:00 time. October 7th is also a holiday... I keep thinking this is a Koha::Calendar bug but I'm not sure how yet... overall the time and time_zone handling looks OK. But there must be somewhere that the time for now() must be used with a time_zone of Australia/Sydney on October 6th... Ok, I think that I've got it... my $datedue = dt_from_string(); $datedue->set_hour('02'); $datedue->set_minute('54'); my $dur = DateTime::Duration->new( days => 14); my $branchcode = 'CPL'; my $daysmode = 'Calendar'; my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => $daysmode ); -- The above will produce the fatal error: "Invalid local time for date in time zone: Australia/Sydney" (In reply to David Cook from comment #2) > Ok, I think that I've got it... Ooops, didn't copy the code quite correctly. my $datedue = dt_from_string(); $datedue->set_hour('02'); $datedue->set_minute('54'); my $dur = DateTime::Duration->new( days => 14); my $branchcode = 'CPL'; my $daysmode = 'Calendar'; my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => $daysmode ); $datedue = $calendar->addDuration( $datedue, $dur, 14 ); Ok going to update the title from "AddRenewal dies due to daylight savings time issue and some other unknown factor" to "Koha::Calendar dies on invalid datetimes during addDuration()". The actual problem functions are used by addDuration(), so more investigation is needed, but yeah... not fun. |