]> git.koha-community.org Git - koha.git/commit
Bug 13226: 9999-12-31 should not considered as a valid date
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 12 Nov 2014 16:14:32 +0000 (17:14 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 14 Nov 2014 14:01:27 +0000 (11:01 -0300)
commit57dff1e63f5778a427390215f82909a82f54eccd
tree36de6e2a9cc6e0f23fb0f83d514915a4f8d02ba7
parent87faa1f8304dc5db12e2cd968ac8a2cb6ab6e176
Bug 13226: 9999-12-31 should not considered as a valid date

DateTime::Format::DateParse (called in Koha::DateUtils::dt_from_string)
does not manage to parse 9999-12-31 if a time zone is given.

my $date = DateTime->new(year => 9999, month => 12, day => 31);
 => OK

DateTime::Format::DateParse->parse_datetime( '9999-12-31' );
 => OK

DateTime::Format::DateParse->parse_datetime( '9999-12-31',
 'America/Los_Angeles' );
 => KO (~20sec on my laptop)

It should not be considered as a valid date when the letter is parsed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Note that to reproduce the problem you much be checking in items from an
account which has been restricted indefinitely (either manually or by
the overdues process). With this patch such checkins go from taking
around 50 seconds (in my test system) to around 7 to 10 seconds.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch! Works as described, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Letters.pm