Instance Method

maximumRange(of:)

The maximum range limits of the values that a given component can take on.

Declaration

func maximumRange(of component: Calendar.Component) -> Range<Int>?

Parameters

component

A component to calculate a range for.

Return Value

The range, or nil if it could not be calculated.

Discussion

As an example, in the Gregorian calendar the maximum range of values for the Day component is 1-31.

See Also

Getting Calendar Information

var identifier: Calendar.Identifier

The identifier of the calendar.

var locale: Locale?

The locale of the calendar.

var firstWeekday: Int

The first weekday of the calendar.

var minimumDaysInFirstWeek: Int

The number of minimum days in the first week.

var timeZone: TimeZone

The time zone of the calendar.

func minimumRange(of: Calendar.Component) -> Range<Int>?

Returns the minimum range limits of the values that a given component can take on.

func ordinality(of: Calendar.Component, in: Calendar.Component, for: Date) -> Int?

Returns, for a given absolute time, the ordinal number of a smaller calendar component (such as a day) within a specified larger calendar component (such as a week).

func range(of: Calendar.Component, in: Calendar.Component, for: Date) -> Range<Int>?

Returns the range of absolute time values that a smaller calendar component (such as a day) can take on in a larger calendar component (such as a month) that includes a specified absolute time.