Enumeration

NSCalendarOptions

The options for arithmetic operations involving calendars.

Declaration

typedef enum NSCalendarOptions : NSUInteger {
    ...
} NSCalendarOptions;

Topics

Constants

NSCalendarWrapComponents

Specifies that the components specified for an NSDateComponents object should be incremented and wrap around to zero/one on overflow, but should not cause higher units to be incremented.

NSCalendarMatchStrictly

Specifies that the operation should travel as far forward or backward as necessary looking for a match.

NSCalendarSearchBackwards

Specifies that the operation should travel backwards to find the previous match before the given date.

NSCalendarMatchPreviousTimePreservingSmallerUnits

Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given NSDateComponents object, this method uses the previous existing value of the missing unit and preserves the lower units' values.

NSCalendarMatchNextTimePreservingSmallerUnits

Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given NSDateComponents object, this method uses the next existing value of the missing unit and preserves the lower units' values.

NSCalendarMatchNextTime

Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given NSDateComponents object, this method uses the next existing value of the missing unit and does not preserve the lower units' values.

NSCalendarMatchFirst

Specifies that, if there are two or more matching times, the operation should return the first occurrence.

NSCalendarMatchLast

Specifies that, if there are two or more matching times, the operation should return the last occurrence.

NSWrapCalendarComponents

Specifies that the components specified for an NSDateComponents object should be incremented and wrap around to zero/one on overflow, but should not cause higher units to be incremented.

Deprecated

See Also

Scanning Dates

- startOfDayForDate:

Returns the first moment of a given date as a date instance.

- enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:

Computes the dates that match (or most closely match) a given set of components, and calls the block once for each of them, until the enumeration is stopped.

- nextDateAfterDate:matchingComponents:options:

Returns the next date after a given date matching the given components.

- nextDateAfterDate:matchingHour:minute:second:options:

Returns the next date after a given date that matches the given hour, minute, and second, component values.

- nextDateAfterDate:matchingUnit:value:options:

Returns the next date after a given date matching the given calendar unit value.

NSWrapCalendarComponents

A legacy constant used to control overflow in date calculations.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software