Nativescript-ui-feedback: RadDataForm: TimePicker 24 hour format

Created on 6 Oct 2017  路  9Comments  路  Source: ProgressNS/nativescript-ui-feedback

How to set TimePicker to 24 hour format?
I need to get into public setIs24HourView(is24HourView: java.lang.Boolean): void; method in TimePicker class. How can i access it?
timer

backlog dataform feature

Most helpful comment

This is very bad news for me. According to https://i.stack.imgur.com/43dwH.jpg most people use 24h format. Can i use custom TimePicker component inside RadDataForm or only RadDataForms compononents are allowed?

All 9 comments

Hi @bori87,
The Time editor internally does not use the TimePicker that you reference, but the TimePickerDialog. Its only option to change whether the format is 24H or not is in its constructor. This means that you have no option to change the format later and currently we haven't exposed a way to provide it before the widget is constructed as well. We will consider such feature for future releases, but I can't commit to a certain date when this feature would be available.

Thank you but i dont know how to access the TimePickerDialog. There is only .getDialog() method in my timePickerEditor.

Yes, the .getDialog() will return the TimePickerDialog that the editor uses. Unfortunately this will not help you as the TimePickerDialog doesn't have an option to change its format. We will have to implement another property for the editor that you would be able to set and change the format. In other words, until we provide a specific option (in a future release), you can't change the format of this editor.

This is very bad news for me. According to https://i.stack.imgur.com/43dwH.jpg most people use 24h format. Can i use custom TimePicker component inside RadDataForm or only RadDataForms compononents are allowed?

You can create your own custom editor as demonstrated here. The article shows how to create an editor with Button-s but you can use the same approach for other native components with the required setup - for example - UIDatePicker for iOS and TimePickerDialog (or TimePicker) for Android.

And if it was opensource, some very nice guy could do a PR to fix it, someone a bit more lazy could copy the existing editor, rename it, change that constructor and have proper 24h time selector, then share it on stackoverflow or somewhere else.

But no, we chose to use closed-source software, so it's only our fault we end up f*ed. Fun, right?

Hi @bori87, @atheros,

Contributions are now possible after signing a mutual NDA. If you or anyone else is interested to contribute, contact us at [email protected].

Any progress on this?

Any progress on this?

+1

Was this page helpful?
0 / 5 - 0 ratings