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.
Basics
TimePicker can be easily configured by setting the required properties in the XML declaration or via a code-behind reference.
Binding
The example below demonstrates setting up TimePicker's properties while using data binding.
Time Format
Using the NativeScript's ability to easily access the native Android and iOS APIs is allowing you to further modify the TimePicker behavior. In the example below a demonstration is made on how to change the time format from the default 12-hour (AM/PM) to 24-hour format.
API Reference for the TimePicker Class
Native Component
Android | iOS |
---|---|
android.widget.TimePicker | UIDatePicker |