A date picker lets the user choose a date, a time, a date and time, or a range of dates. Both Gregorian and non-Gregorian calendars are supported.
Choose a style that suits your app. There are two styles of date pickers: textual and graphical. The textual style is useful when space is constrained and you expect users to make specific date and time selections. The graphical style is useful when you want to give users the option of browsing through days in a calendar, when you want to let the user select a range of dates, or when the look of a clock face is appropriate for the user interface of your app.
For developer guidance, see NSDatePicker.
This style is represented by a text field containing one of the following combinations of date and time elements.
|Date and time||Month, day, and year||Hour, minute, and second|
|Date and time||Month, day, and year||Hour and minute|
|Date and time||Month and year||Hour, minute, and second|
|Date and time||Month and year||Hour and minute|
|Date only||Month, day, and year||None|
|Date only||Month and year||None|
|Time only||None||Hour, minute, and second|
|Time only||None||Hour and minute|
The user can change the date or time by selecting an element in the field and typing a new value, using the Up Arrow key to increment the element’s value, or using the Down Arrow key to decrement the element’s value. By default, the field includes a stepper, which the user can also use to increment or decrement the selected element’s value. The stepper can be hidden if your it makes sense in your app. Note that the order of elements displayed in a textual date picker may vary based on the user’s locale.
This style is represented by a graphical calendar, clock, or both. In the calendar, the user can navigate to and select a specific date or, if your app allows it, a range of dates. In the clock, the user can change the time by clicking the hands and dragging them to a new position.