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

Colin Campbell <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |colin.campbell@ptfs-europe.
                   |                            |com

--- Comment #38 from Colin Campbell <[email protected]> ---
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.
_______________________________________________
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