]> git.koha-community.org Git - koha.git/commit
Bug 15166: Make output_pref takes a string in parameter
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 10 Nov 2015 16:38:51 +0000 (16:38 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 13 Nov 2015 14:24:06 +0000 (11:24 -0300)
commit320d2c586a51d6b6acce3576c4c89b0b36959bbc
treee676924a4263d5c7a06619e4f09f65a64e23d8c9
parent0c33f1d1e6481562c5898afb1289fe8a946e4d7a
Bug 15166: Make output_pref takes a string in parameter

To simplify the management of dates, it would be great that output_pref takes a string in parameter.

  my $date = $input->param('my_date');
  $date = eval { dt_from_string( $date ) } if $date;
  $date = output_pref({dt => $date}) if $date;

Could be replace with:

  my $date = output_pref({ str => $input->param('my_date') });

Tested with t/DateUtils.t, passed OK.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/DateUtils.pm
t/DateUtils.t