Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
rcebryk
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
Accepted Solution

How to show only hh:mm in DateTimePicker in 24hr mode?

Hello everyone,

 

Is there a way to make DateTimePicker show only two columns: hours and minutes in 24hrs format (without AM, PM)?

 

The best for me would be to set the mode to Time - but it uses the 12hrs format (with AM, PM). Should I do something with Locales in order to change it, so it would show for example 14:02 instead of 02:02 PM?

 

The other try: the Timer format would also be great if it would not show the "seconds" column:smileywink:

 

Thanks for help,

 

Rafal.

Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: How to show only hh:mm in DateTimePicker in 24hr mode?

Others, including me, have wondered the same. Unfortunately there's currently no way to customized it beyond the very basic few combinations of date/time that they show in the docs.

In my case, I didn't need a really fine-grained time, so I resorted to a simple DropDown with a pre-selected useful list of time values (e.g. 0:10, 0:30, 1:00, 2:00, etc), though that's definitely not optimal.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
rcebryk
Posts: 84
Registered: ‎12-01-2012
My Device: 9790

Re: How to show only hh:mm in DateTimePicker in 24hr mode?

Thanks, that's a pitty. I tried even to use the minuteInterval =5 but still AM/PM shows up, and in TImer mode it does not work.. I will do it other way, thanks. After a while I think just a range from 5 to 240 minutes will suit me so I will use slider or something like that

Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.
Developer
mzex
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C

Re: How to show only hh:mm in DateTimePicker in 24hr mode?

I guess it depends on phone regional settings. When i set proper time zone for my location (Europe) and enabled "24hour" switch in time and date settings, DateTimePicker started to display in 24 hour time.

Developer
rcebryk
Posts: 84
Registered: ‎12-01-2012
My Device: 9790

Re: How to show only hh:mm in DateTimePicker in 24hr mode?

So you had to switch the time and date settings. I need it to work despite the date and time settings. Changing the deafult locale did not work. I guess it is impossible:smileyhappy: I already have a drop down list:smileyhappy:
Lublin BlackBerry Developer Group


---
If I helped you please mark my response as solution or "Like" it.