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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
My Carrier: Orange
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" columnSmiley Wink

 

Thanks for help,

 

Rafal.

Lublin BlackBerry Developer Group


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

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
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
My Carrier: Orange

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
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

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
Posts: 84
Registered: ‎12-01-2012
My Device: 9790
My Carrier: Orange

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 impossibleSmiley Happy I already have a drop down listSmiley Happy
Lublin BlackBerry Developer Group


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