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

--- Comment #9 from M. Tompsett <[email protected]> ---
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.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to