From fc9a811419341f336550951fa8ff08cf8913b39b Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 11 Jul 2012 14:47:41 +0200 Subject: [PATCH] Bug 8418 - fix dt->truncate( to => 'day' ) Signed-off-by: Chris Cormack --- Koha/Calendar.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index ab01e53..2c372f2 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -147,7 +147,7 @@ sub is_holiday { if ( $self->{weekly_closed_days}->[$dow] == 1 ) { return 1; } - $dt->truncate( to => 'days' ); + $dt->truncate( to => 'day' ); my $day = $dt->day; my $month = $dt->month; if ( exists $self->{day_month_closed_days}->{$day}->{$month} ) { @@ -189,8 +189,8 @@ sub days_between { sub hours_between { my ($self, $start_dt, $end_dt) = @_; my $duration = $end_dt->delta_ms($start_dt); - $start_dt->truncate( to => 'days' ); - $end_dt->truncate( to => 'days' ); + $start_dt->truncate( to => 'day' ); + $end_dt->truncate( to => 'day' ); # NB this is a kludge in that it assumes all days are 24 hours # However for hourly loans the logic should be expanded to # take into account open/close times then it would be a duration -- 1.7.10.4