Instance Method

nextWeekendStartDate:interval:options:afterDate:

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

Declaration

- (BOOL)nextWeekendStartDate:(out NSDate * _Nullable *)datep interval:(out NSTimeInterval *)tip options:(NSCalendarOptions)options afterDate:(NSDate *)date;

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 (NSCalendarSearchBackwards), 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

NO if the calendar and locale do not have the concept of a weekend, otherwise YES.

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

- dateFromComponents:

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

- dateByAddingComponents:toDate:options:

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

- dateByAddingUnit:value:toDate:options:

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

- dateBySettingHour:minute:second:ofDate:options:

Creates a new date calculated with the given time.

- dateBySettingUnit:value:ofDate: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.

- dateWithEra:year:month:day:hour:minute:second:nanosecond:

Returns a date created with the given components.

- dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:

Returns a new date created with the given components base on a week-of-year value.