* Computes a date by using the components set in this NSDateComponents * instance. *
** A calendar (and optionally a time zone) must be set prior to * calling this method. *
*/ - (NSDate *) date; /** Returns the number of the week in this month. */ - (NSInteger) weekOfMonth; /** * Returns the number of the week in this year. * Identical to callingweek
. */
- (NSInteger) weekOfYear;
/**
* The year corresponding to the current week.
* This value may differ from year around the end of the year.
*
* For example, for 2012-12-31, the year number is 2012, but
* yearForWeekOfYear is 2013, since it's already week 1 in 2013.
*/
- (NSInteger) yearForWeekOfYear;
- (NSInteger) nanosecond;
/** Sets the number of the week in this month. */
- (void) setWeekOfMonth: (NSInteger) v;
/**
* Sets the number of the week in this year.
* Identical to calling -setWeek
. */
- (void) setWeekOfYear: (NSInteger) v;
/**
* Sets the year number for the current week.
* See the explanation at -yearForWeekOfYear
.
*/
- (void) setYearForWeekOfYear: (NSInteger) v;
- (void) setNanosecond: (NSInteger) v;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)
- (BOOL) leapMonth;
- (void) setLeapMonth: (BOOL) v;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
- (BOOL) isValidDate;
- (BOOL) isValidDateInCalendar: (NSCalendar *) calendar;
- (NSInteger) valueForComponent: (NSCalendarUnit) unit;
- (void) setValue: (NSInteger) value
forComponent: (NSCalendarUnit) unit;
#endif
@end
@interface NSCalendar : NSObject