Instance Method

nextWeekendStart(_:interval:options:after:)

Returns by reference the starting date and time interval range of the next weekend period after a given date.

Declaration

func nextWeekendStart(_ datep: AutoreleasingUnsafeMutablePointer<NSDate?>?, interval tip: UnsafeMutablePointer<TimeInterval>?, options: NSCalendar.Options = [], after date: Date) -> Bool

Parameters

datep

Upon return, contains the starting date of the next weekend period.

tip

Upon return, contains the time interval of the next weekend period.

options

Options for the calculation. If you specify a backward search option (searchBackwards), the starting date and time interval range of the preceding weekend period will be returned by reference instead.

date

The date for which to perform the calculation.

Return Value

false if the calendar and locale do not have the concept of a weekend, otherwise true.

Discussion

Note that a particular calendar day may not necessarily fall entirely within a weekend period, as weekends can start in the middle of a day in some calendars and locales.

See Also

Calculating Dates

func date(from: DateComponents)

Returns a date representing the absolute time calculated from given components.

func date(byAdding: DateComponents, to: Date, options: NSCalendar.Options = [])

Returns a date representing the absolute time calculated by adding given components to a given date.

func date(byAdding: NSCalendar.Unit, value: Int, to: Date, options: NSCalendar.Options = [])

Returns a date representing the absolute time calculated by adding the value of a given component to a given date.

func date(bySettingUnit: NSCalendar.Unit, value: Int, of: Date, options: NSCalendar.Options = [])

Returns a new date representing the date calculated by setting a specific component of a given date to a given value, while trying to keep lower components the same.