Skip to content

DateRange

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\DateRange
Since
4.3.0

Class DateRange

View source

Public Methods

MethodDescription
dateIntervalByTimePeriod()
dateRangeByType()Returns the start and end dates for a date range by its type.

dateIntervalByTimePeriod()

Since
4.3.0

View source

Arguments

Returns

DateInterval

dateRangeByType()

Returns the start and end dates for a date range by its type.

View source

Arguments

Returns

DateTime[]

Constants

ConstantDescription
PERIOD_DAYS_AGO
PERIOD_DAYS_FROM_NOW
PERIOD_HOURS_AGO
PERIOD_HOURS_FROM_NOW
PERIOD_MINUTES_AGO
PERIOD_MINUTES_FROM_NOW
PERIOD_SECONDS_AGO
PERIOD_SECONDS_FROM_NOW
PERIOD_WEEKS_AGO
PERIOD_WEEKS_FROM_NOW
TYPE_AFTER
TYPE_BEFORE
TYPE_PAST_30_DAYS
TYPE_PAST_7_DAYS
TYPE_PAST_90_DAYS
TYPE_PAST_YEAR
TYPE_RANGE
TYPE_THIS_MONTH
TYPE_THIS_WEEK
TYPE_THIS_YEAR
TYPE_TODAY