Mac Developer Library

Developer

AppKit Framework Reference NSDatePickerCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSDatePickerCell

An NSDatePickerCell instance controls the behavior of an NSDatePicker control, or of a single date picker cell in a matrix.

  • The date currently specified in the picker.

    Declaration

    Swift

    @NSCopying var dateValue: NSDate

    Objective-C

    @property(copy) NSDate *dateValue

    Discussion

    Assign a date to this property to set the starting value for the picker. For range-based dates, use the timeInterval property to set the extent of the time range.

    Availability

    Available in OS X v10.4 and later.

  • The time interval that represents the date range.

    Declaration

    Swift

    var timeInterval: NSTimeInterval

    Objective-C

    @property NSTimeInterval timeInterval

    Discussion

    The date range begins at the date in the dateValue property. The value in this property applies only when the date picker is in the NSRangeDateMode mode.

    Availability

    Available in OS X v10.4 and later.

  • The calendar used by the date picker.

    Declaration

    Swift

    @NSCopying var calendar: NSCalendar?

    Objective-C

    @property(copy) NSCalendar *calendar

    Availability

    Available in OS X v10.4 and later.

  • The locale used to display dates.

    Declaration

    Swift

    @NSCopying var locale: NSLocale?

    Objective-C

    @property(copy) NSLocale *locale

    Availability

    Available in OS X v10.4 and later.

  • The time zone used to display time-related values.

    Declaration

    Swift

    @NSCopying var timeZone: NSTimeZone?

    Objective-C

    @property(copy) NSTimeZone *timeZone

    Availability

    Available in OS X v10.4 and later.

  • The minimum date that the picker allows as input.

    Declaration

    Swift

    @NSCopying var minDate: NSDate?

    Objective-C

    @property(copy) NSDate *minDate

    Discussion

    Set this property to nil if you want to allow any value for the minimum date.

    Availability

    Available in OS X v10.4 and later.

    See Also

    maxDate

  • The maximum date that the picker allows as input.

    Declaration

    Swift

    @NSCopying var maxDate: NSDate?

    Objective-C

    @property(copy) NSDate *maxDate

    Discussion

    Set this property to nil if you want to allow any value for the maximum date.

    Availability

    Available in OS X v10.4 and later.

    See Also

    minDate

  • Constants that define the visual appearance of the date picker cell.

    Declaration

    Swift

    enum NSDatePickerStyle : UInt { case TextFieldAndStepperDatePickerStyle case ClockAndCalendarDatePickerStyle case TextFieldDatePickerStyle }

    Objective-C

    typedef enum NSDatePickerStyle : NSUInteger { NSTextFieldAndStepperDatePickerStyle = 0, NSClockAndCalendarDatePickerStyle = 1, NSTextFieldDatePickerStyle = 2 } NSDatePickerStyle;

    Constants

    • TextFieldAndStepperDatePickerStyle

      NSTextFieldAndStepperDatePickerStyle

      Provide a text field and stepper style interface.

      Available in OS X v10.4 and later.

    • ClockAndCalendarDatePickerStyle

      NSClockAndCalendarDatePickerStyle

      Provide a visual clock and calendar style interface.

      Available in OS X v10.4 and later.

    • TextFieldDatePickerStyle

      NSTextFieldDatePickerStyle

      Provide a text field interface.

      Available in OS X v10.5 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Constants that define whether the picker provides a single date, or a range of dates.

    Declaration

    Swift

    enum NSDatePickerMode : UInt { case SingleDateMode case RangeDateMode }

    Objective-C

    typedef enum NSDatePickerMode : NSUInteger { NSSingleDateMode = 0, NSRangeDateMode = 1 } NSDatePickerMode;

    Constants

    • SingleDateMode

      NSSingleDateMode

      Allow selection of a single date.

      Available in OS X v10.4 and later.

    • RangeDateMode

      NSRangeDateMode

      Allow selection of a range of dates. (First implemented in OS X v 10.5.)

      Available in OS X v10.4 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Constants that specify the date and time elements displayed by the picker.

    Declaration

    Swift

    struct NSDatePickerElementFlags : OptionSetType { init(rawValue rawValue: UInt) static var HourMinuteDatePickerElementFlag: NSDatePickerElementFlags { get } static var HourMinuteSecondDatePickerElementFlag: NSDatePickerElementFlags { get } static var TimeZoneDatePickerElementFlag: NSDatePickerElementFlags { get } static var YearMonthDatePickerElementFlag: NSDatePickerElementFlags { get } static var YearMonthDayDatePickerElementFlag: NSDatePickerElementFlags { get } static var EraDatePickerElementFlag: NSDatePickerElementFlags { get } }

    Objective-C

    typedef enum NSDatePickerElementFlags : NSUInteger { NSHourMinuteDatePickerElementFlag = 0x000c, NSHourMinuteSecondDatePickerElementFlag = 0x000e, NSTimeZoneDatePickerElementFlag = 0x0010, NSYearMonthDatePickerElementFlag = 0x00c0, NSYearMonthDayDatePickerElementFlag = 0x00e0, NSEraDatePickerElementFlag = 0x0100, } NSDatePickerElementFlags;

    Constants

    • HourMinuteDatePickerElementFlag

      NSHourMinuteDatePickerElementFlag

      Display and allow editing of the hour and minute elements of the date.

      Available in OS X v10.4 and later.

    • HourMinuteSecondDatePickerElementFlag

      NSHourMinuteSecondDatePickerElementFlag

      Display and allow editing of the hour, minute and second elements of the date.

      Available in OS X v10.4 and later.

    • TimeZoneDatePickerElementFlag

      NSTimeZoneDatePickerElementFlag

      Display and allow editing of the time zone.

      This flag has been declared for possible future use, and does not yet have any effect.

      Available in OS X v10.4 and later.

    • YearMonthDatePickerElementFlag

      NSYearMonthDatePickerElementFlag

      Display and allow editing of the year and month elements of the date.

      Available in OS X v10.4 and later.

    • YearMonthDayDatePickerElementFlag

      NSYearMonthDayDatePickerElementFlag

      Display and allow editing of the year, month and day elements of the date.

      Available in OS X v10.4 and later.

    • EraDatePickerElementFlag

      NSEraDatePickerElementFlag

      Display and allow editing of the era of the date, if applicable.

      This flag has been declared for possible future use, and does not yet have any effect.

      Available in OS X v10.4 and later.

    Discussion

    You can combine these constants using the C bitwise OR operator.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.