Time Picker

NativeScript provides a TimePicker control that enables users to choose a time as a ready-to-use dialog. Every time part can be picked separately by its corresponding section of the control - for hour, minutes and AM/PM.

API Reference for the TimePicker Class

Native Component

Android iOS
android.widget.TimePicker UIDatePicker

Image

Configure Time Picker

TimePicker can be easily configured by setting the required properties.

HTML

<TimePicker (loaded)="onPickerLoaded($event)" verticalAlignment="center" class="m-15"></TimePicker>

TypeScript

onPickerLoaded(args) {
    let timePicker = <TimePicker>args.object;

    timePicker.hour = 9;
    timePicker.minute = 25;
}

Improve this document

Demo Source


Is this article helpful? Yes / No
Thank you for your feedback!

Tell us how we can improve this article

NativeScript
NativeScript is licensed under the Apache 2.0 license .
© Progress Software Corporation. All Rights Reserved.