DateRange

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

Class DateRange

View source (opens new window)

# Public Methods

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

# dateIntervalByTimePeriod()

Since
4.3.0

View source (opens new window)

Arguments

Returns

DateInterval (opens new window)

# dateRangeByType()

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

View source (opens new window)

Arguments

Returns

DateTime (opens new window)[]

# Constants

Constant Description
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