View | Details | Raw Unified | Return to bug 8045
Collapse All | Expand All

(-)a/Koha/Calendar.pm (-7 / +9 lines)
Lines 169-181 sub days_between { Link Here
169
    my $start_dt = shift;
169
    my $start_dt = shift;
170
    my $end_dt   = shift;
170
    my $end_dt   = shift;
171
171
172
    my $datestart_temp = $start_dt->clone();
173
    my $dateend_temp = $end_dt->clone();
174
172
    # start and end should not be closed days
175
    # start and end should not be closed days
173
    my $duration = $end_dt->delta_days($start_dt);
176
    my $duration = $dateend_temp->delta_days($datestart_temp);
174
    $start_dt->truncate( to => 'days' );
177
    $datestart_temp->truncate( to => 'days' );
175
    $end_dt->truncate( to => 'days' );
178
    $dateend_temp->truncate( to => 'days' );
176
    while ( DateTime->compare( $start_dt, $end_dt ) == -1 ) {
179
    while ( DateTime->compare( $datestart_temp, $dateend_temp ) == -1 ) {
177
        $start_dt->add( days => 1 );
180
        $datestart_temp->add( days => 1 );
178
        if ( $self->is_holiday($start_dt) ) {
181
        if ( $self->is_holiday($datestart_temp) ) {
179
            $duration->subtract( days => 1 );
182
            $duration->subtract( days => 1 );
180
        }
183
        }
181
    }
184
    }
182
- 

Return to bug 8045