Bug 13242: Fix DateUtils for 'infinite' dates (ie year 9999)
TEST PLAN:
- Method 1--with UT
- Use the UT associated to this bug, without applying this patch, and then
after applying this patch
- Method 2--using Koha
- Without this patch
- Find a borrower with several checkouts that are not overdue.
- Debarred the borrower
- Go on circ/circulation-home.pl page
- Select Check in tab, and do a check in
- It required more than 20s to display the return.pl page
- Apply the patch, and repeat previous steps
=> return.pl is immediately displayed.
Followed method 2. Time problem no longer exists.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
752c8bf043
commit
0a41d247b5
|
|
@ -53,6 +53,11 @@ to the system preferences. If the date string is empty DateTime->now is returned
|
|||
|
||||
sub dt_from_string {
|
||||
my ( $date_string, $date_format, $tz ) = @_;
|
||||
|
||||
# FIXME: see bug 13242 => no TZ for dates 'infinite'
|
||||
return DateTime::Format::DateParse->parse_datetime($date_string)
|
||||
if $date_string =~ /^9999-/;
|
||||
|
||||
if ( !$tz ) {
|
||||
$tz = C4::Context->tz;
|
||||
}
|
||||
|
|
@ -123,7 +128,8 @@ sub output_pref {
|
|||
|
||||
return unless defined $dt;
|
||||
|
||||
$dt->set_time_zone( C4::Context->tz );
|
||||
# FIXME: see bug 13242 => no TZ for dates 'infinite'
|
||||
$dt->set_time_zone( C4::Context->tz ) if $dt->ymd !~ /^9999/;
|
||||
|
||||
my $pref =
|
||||
defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
|
||||
|
|
|
|||
Loading…
Reference in New Issue