diff --git a/Koha/Patron.pm b/Koha/Patron.pm index ab498218bb..6f31ec4937 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -657,7 +657,7 @@ sub is_going_to_expire { return 0 unless $delay; return 0 unless $self->dateexpiry; return 0 if $self->dateexpiry =~ '^9999'; - return 1 if dt_from_string( $self->dateexpiry )->subtract( days => $delay ) < dt_from_string->truncate( to => 'day' ); + return 1 if dt_from_string( $self->dateexpiry, undef, 'floating' )->subtract( days => $delay ) < dt_from_string(undef, undef, 'floating')->truncate( to => 'day' ); return 0; } diff --git a/acqui/duplicate_orders.pl b/acqui/duplicate_orders.pl index 549c8b495a..a4a02fc628 100755 --- a/acqui/duplicate_orders.pl +++ b/acqui/duplicate_orders.pl @@ -74,7 +74,7 @@ my $to_placed_on = unless ( $input->param('from') ) { # Fill the form with year-1 - $from_placed_on->subtract( years => 1 ); + $from_placed_on->set_time_zone('floating')->subtract( years => 1 ); } $filters->{from_placed_on} = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ), diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index f5dca499c8..93bca344fd 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -94,7 +94,7 @@ my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || my $to_placed_on = eval { dt_from_string( scalar $input->param('to') ) } || dt_from_string; unless ( $input->param('from') ) { # Fill the form with year-1 - $from_placed_on->subtract( years => 1 ); + $from_placed_on->set_time_zone('floating')->subtract( years => 1 ); } $filters->{from_placed_on} = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ), $filters->{to_placed_on} = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ),