Class DateTimePeriod
DatePeriod wrapper that returns DateTime instances.
Namespace: Cake\I18n
Property Summary
-
$iterator protected
Iterator<int, \DateTimeInterface>
Method Summary
-
__construct() public
-
current() public
-
isZeroInterval() protected static
Check if a DateInterval is effectively zero.
-
key() public
-
next() public
-
rewind() public
-
valid() public
Method Detail
__construct() ¶ public
__construct(DatePeriod $period)
Parameters
-
DatePeriod$period The DatePeriod to wrap.
Throws
InvalidArgumentExceptionIf the period has a zero interval which would cause an infinite loop.
isZeroInterval() ¶ protected static
isZeroInterval(DateInterval $interval): bool
Check if a DateInterval is effectively zero.
Parameters
-
DateInterval$interval The interval to check.
Returns
boolTrue if the interval is zero.