Skip to content

DatePicker

Presents a date picker.

Use the date picker to select a date. After configuring the date picker, call pickTime(), pickDate(), pickDateAndTime() or pickCountDownTimer() which will present the date picker modally. The pickTime(), pickDate() and pickDateAndTime() methods returns a promise that carries the selected date and the pickCountDownTimer() method retrns a promise that carries the selected duration.

The date picker can be configured towards picking a date with or without time, just a time or picking hours and minutes for a timer.

minimumDate

Minimum date that is selected in the picker.

The minimum date, along with the maximum date, specifies the valid date range. The minimum and maximum dates are ignored if the minimum date is greater than the maximum date. The dates are also ignored in countdown-timer mode.

minimumDate: Date

maximumDate

Maximum date that is selected in the picker.

The maximum date, along with the minimum date, specifies the valid date range. The minimum and maximum dates are ignored if the minimum date is greater than the maximum date. The dates are also ignored in countdown-timer mode.

maximumDate: Date

countdownDuration

Countdown duration displayed by the date picker.

Use this property to get and set the duration of a countdown when calling the pickCountDownDuration() function to present the picker. The default value is zero and the maximum value is 23:59 (86,399 seconds).

countdownDuration: number

minuteInterval

Interval at which the date picker displays minutes.

Use the property to set the interval of the minute wheel. The default and minimum value is 1 and the maximum value is 30.

minuteInterval: number

initialDate

The initially selected date.

Use this property to specify the initially selected date and time when picking a date, a time or both using date picker. If no date is specified, the current date and time will be selected initially.

Be aware that this property does not hold the selected date after the date picker has been dismissed. The promises returned by pickTime(), pickDate() and PickDateAndTime() carries the selected date.

initialDate: Date

-new DatePicker

Constructs a new date picker.

new DatePicker()

Use the date picker to present a view for selecting a date.

The date picker can be configured towards picking a date with or without time, just a time or picking hours and minutes for a timer.


-pickTime

Presents the date picker displaying hours and minutes.

pickTime(): Promise<Date>

Use the method to pick a time. The date picker will display hours and minutes and, depending on the locale of the device, an AM/PM designation.

The returned date will be the current date with the hour and minute set to the selected values. Use the initialDate property to set the initially selected date.

Return value

Promise
Promise that carries the selected time when fulfilled.


-pickDate

Presents the date picker displaying day, month and year.

pickDate(): Promise<Date>

Use the method to pick a date. The date picker will display the, day, month and year. Use the initialDate property to set the initially selected date.

Return value

Promise
Promise that carries the selected date when fulfilled.


-pickDateAndTime

Presents the date picker displaying date and time.

pickDateAndTime(): Promise<Date>

Use the method to pick a date and a time. The date picker will display the day, month, year, hour, minutes and, depending on the locale of the device, an AM/PM designation. Use the initialDate property to set the initially selected date.

Return value

Promise
Promise that carries the selected date and time when fulfilled.


-pickCountdownDuration

Presents the date picker for selecting the duration of a countdown.

pickCountdownDuration(): Promise<number>

Use the method to pick the duration of a countdown, e.g. a timer. The date picker will display hours and minutes. Use the countdownDuration property to set the initially selected duration.

Return value

Promise
Promise that carries the selected duration when fulfilled.