trait IntervalStep

Properties

protectedClosure|null $step Step to apply instead of a fixed interval to get the new date.

Methods

getStep()

Get the dynamic step in use.

setStep(Closure|null$step)

Set a step to apply instead of a fixed interval to get the new date.

convertDate(DateTimeInterface$dateTime,bool$negated =false)

Take a date and apply either the step if set, or the current interval else.

Details

at line35
Closure getStep()

Get the dynamic step in use.

Return Value

Closure

at line47
setStep(Closure|null$step)

Set a step to apply instead of a fixed interval to get the new date.

Or pass null to switch to fixed interval.

Parameters

Closure|null $step

at line62
CarbonInterface convertDate(DateTimeInterface$dateTime,bool$negated =false)

Take a date and apply either the step if set, or the current interval else.

The interval/step is applied negatively (typically subtraction instead of addition) if $negated is true.

Parameters

DateTimeInterface $dateTime
bool $negated

Return Value

CarbonInterface