Skip to content

Commit

Permalink
bug: #196 support php7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
michalananapps committed Nov 7, 2024
1 parent 47aebd6 commit bed190b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function apply($element)
return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $element->getEndDate(), $options);
}

return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $element->getRecurrences(), $options);
if (PHP_VERSION_ID >= 70217) {
$recurrences = $element->getRecurrences();
} else {
$recurrences = $element->recurrences - $element->include_start_date;
}

return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $recurrences, $options);
}
}

0 comments on commit bed190b

Please sign in to comment.