From 6229ef40deab1d7e422602894666c2ed89ba5401 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' ) --- Koha/Calendar.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index ab01e53..67fc646 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -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.2.5