[Koha-bugs] [Bug 10694] Allow arbitrary backdating of returns

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 23 12:37:39 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10694

--- Comment #39 from Kyle M Hall <kyle at bywatersolutions.com> ---
Colin, there is no place in these patches where I make a change like that.

(In reply to Colin Campbell from comment #38)
> This changes the api of a routine used in many places so the change should
> be clearer. The return_date is an optional parameter but this is not
> indicated in the documentation of the subroutine, a comment or even
> explicitly in the code, being handled as a side effect of the date routines.
> 
> Instead of replacing 
>  my $today = DateTime->now( time_zone => C4::Context->tz() );
> by
>   my $today = dt_from_string( $return_date, 'iso' );
> 
> can I suggest that:
>    my $today;
>    if ($return_date) {
>       $today = dt_from_string( $return_date, 'iso' );
>    }
>    else {
>       $today = DateTime->now( time_zone => C4::Context->tz() );
>    }
> 
> makes the logic a bit clearer without forcing the reader to inspect the
> DateUtils code to see that having a return_date is not required

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list