[Koha-bugs] [Bug 30518] StockRotationItems crossing DST boundary throw invalid local time exception
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Apr 13 11:51:59 CEST 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30518
--- Comment #2 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 133234
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133234&action=edit
Bug 30518: Correct DateTime maths for needs_advancing
The needs_advancing method prior to this patch used basic DateTime
arithmatic, adding a DateTime::Duration in Days to the Arrival date of
the item and then comparing that to today. This, however, can cause bugs
when the arrival + duration date coincides with a DST boundary and as
such may result in an invalid local date. See
https://metacpan.org/pod/DateTime#Making-Things-Simple for further
details.
This patch updates the code to use the DST safe delta_days method to
count the days between arrival and now instead and then compares this
integer to the defined duration of the stage.
To test:
1. Re-run the unit tests, they should now pass.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list