[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
Sat Jun 11 17:05:33 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16376

Jonathan Druart <jonathan.druart at bugs.koha-community.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA

--- Comment #17 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to David Cook from comment #13)
> (In reply to Jonathan Druart from comment #11)
> > Ok you will remove the software error, but I am not sure it's the way to go.
> > 
> 
> I would certainly prefer a more thorough overhaul of Koha's DateTime
> handling, but I think this is good enough for now. Chile can't use the
> overdue functionality in Koha at all at this stage without this fix.
> 
> > Currently the dates are stored in local time (so with the tz), if we want to
> > switch to floating time zones (what we should do at some point!) I think we
> > should recalculate all dates present in DB.
> > An easy workaround would be to use Koha::DateUtils, which deals (at least
> > try to) with invalid dates due du DST.
> 
> Well, we calculate and interpret the dates using local time, but they're
> stored without timezone in the database.
> 
> So I'm not sure what you mean by "recalculate all dates present in DB". The
> only difference between "local" and "floating" is the timezone. They're the
> same numbers, so there would be no recalculation to do. Or do you mean we
> should recalculate into UTC?

If we plan to support several timezone, I think we will need to recalculate the
existing dates into UTC, yes.

> Even if it were stored in UTC, it would need to be converted to local, and
> then to floating for the actual date handling, as we'd need the local
> numbers before doing any datetime math/truncation for the holiday checks.

Yes, floating times for calculation and tz to display/store the values. But
let's have this discussion somewhere else :)

> I have my reservations about Koha::DateUtils... I don't think enough thought
> has been put into its implementation. Besides, it wouldn't work in this case.

Well, look at the code before and after, we you will understand how it has been
useful :)

Looking at your patch again, it looks good.
Please provide tests to highlight the issue you are trying to fix and to make
sure this patch won't introduce regressions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list