@@ -, +, @@ --- Koha/Calendar.pm | 7 +++++++ 1 file changed, 7 insertions(+) --- a/Koha/Calendar.pm +++ a/Koha/Calendar.pm @@ -247,6 +247,13 @@ sub days_between { my $start_dt = shift; my $end_dt = shift; + if ( $start_dt->compare($end_dt) > 0 ) { + # swap dates + my $int_dt = $end_dt; + $end_dt = $start_dt; + $start_dt = $int_dt; + } + # start and end should not be closed days my $days = $start_dt->delta_days($end_dt)->delta_days; --