[Koha-bugs] [Bug 20311] get_age tests can fail on February 28th

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 28 18:02:10 CET 2018


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

--- Comment #1 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 72292
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72292&action=edit
Bug 20311: Prevent get_age tests to fail on Feb 28th

Today Feb 28th 2018:
If we subtract 18y to this DateTime object 29/02/2000 and so the patron is not
major yet

use Koha::DateUtils qw( dt_from_string );
say dt_from_string('28/02/2018')->add(years => -18);
say dt_from_string('28/02/2018')->add(years => -18, end_of_month => 'limit');

will display:
2000-02-29T00:00:00
2000-02-28T00:00:00

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


More information about the Koha-bugs mailing list