UIDatePicker() constructor
The UIDatePicker() constructor creates a date picker.
Syntax
new UIDatePicker()Parameters
None.
Return value
A new UIDatePicker:
dateis the moment of creation.datePickerModeis'dateAndTime': both date and time are chosen.preferredDatePickerStyleis'automatic'; on iPhone thedatePickerStyleactually used is'compact'.minimumDateandmaximumDatearenull: no limit.
Examples
js
const picker = new UIDatePicker();
console.log(picker.datePickerMode, picker.datePickerStyle);Result: Prints dateAndTime compact.
Corresponding iOS API
[[UIDatePicker alloc] init].
See also
datePickerMode: what to choosepreferredDatePickerStyle: what it looks like