[Koha-bugs] [Bug 10694] Allow arbitrary backdating of returns
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Apr 22 16:02:26 CEST 2014
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10694
Colin Campbell <colin.campbell at ptfs-europe.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |colin.campbell at ptfs-europe.
| |com
--- Comment #38 from Colin Campbell <colin.campbell at ptfs-europe.com> ---
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