[Koha-bugs] [Bug 23079] Checkouts page broken because of problems with date calculation (TZAmerica/Sao_Paulo)
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Jun 24 20:31:10 CEST 2019
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23079
--- Comment #9 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 90940
--> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90940
Bug 23079: Handle invalid timezones when adding/subtracting durations
Review of attachment 90940:
--> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=23079&attachment=90940)
-----------------------------------------------------------------
::: Koha/Patron.pm
@@ +622,4 @@
> return 0 unless $delay;
> return 0 unless $self->dateexpiry;
> return 0 if $self->dateexpiry =~ '^9999';
> + return 1 if dt_from_string( $self->dateexpiry, undef, 'floating' )->subtract( days => $delay ) < dt_from_string(undef, undef, 'floating')->truncate( to => 'day' );
I'd prefer GMT.
::: acqui/duplicate_orders.pl
@@ +74,4 @@
>
> unless ( $input->param('from') ) {
> # Fill the form with year-1
> + $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
Why not:
$from_placed_on->set_year($from_placed_on->year() - 1);
-- no timezone needed.
::: acqui/histsearch.pl
@@ +94,4 @@
> 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->set_time_zone('floating')->subtract( years => 1 );
Why not:
$from_placed_on->set_year($from_placed_on->year() - 1);
-- no timezone needed.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list