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
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Change display format of DateTimePicker

[ Edited ]

I cannot find a way to format the date/time which is displayed on the right hand side of the closed DateTimePicker. If the DateTimePicker mode is set to Date only the default format is "MM/DD/YY". It stays the same irrespectively if I pass it a value using YYYY-MM-DD string or just pass a JavaScript Date object).

 

When the DateTimePicker is expanded however the dials are using MM - DD - YYYY format. 

 

Go figure.

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: Change display format of DateTimePicker

I came here with google because I also wanted to know how to do it. When I changed my region settings of the device, it also changes the format. So the format is allready localized. No worries for the programmer to do it. It is up to the user to decide how he want to see it, so if he changes the region to where he lives, he will get the format depending of his country...

 

Probably to late for you, but wanted to share it for the others.

______________________________________________________
BB10-OAuth: GitHub
New Member
Posts: 1
Registered: ‎02-17-2013
My Device: 9900
My Carrier: TMobile

Re: Change display format of DateTimePicker

Im also looking for something similar. I want to always display 4 digit year. By default it only shows a 2 digit year. However it does show a 4 digit year in the dropdown (picker list), but that does not suffice my need, I need the full year displayed in the actual date field as well. 

 

Please help.  

 

Contributor
Posts: 24
Registered: ‎11-04-2011
My Device: Bold 9700
My Carrier: Dbydx Software

Re: Change display format of DateTimePicker

I am also facing the same problem. I need to dispaly a date format like "28 Feb 2013". Please provide a solution of this problem.

Developer
Posts: 403
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Change display format of DateTimePicker

I am also having the same problem. Canada uses yyyy-mm-dd (ISO 8601) format. The DateTimePicker shows mm/dd/yy

Developer
Posts: 660
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Re: Change display format of DateTimePicker

I'm sure that format was implemented to be consistent with the spacing.

 

So if you have DateTimePicker title of "Pick a date", you wont have to worry about lengthy months like "December" cutting off your title off when short months like "May" doesn't. It just seem to provide more uniform user experience.

 

Of course, when the control is expanded, the title is no longer required and the date can actually take up the entire width so there's no need for space stingy-ness (if that's even a word).

----------------------------------------------------------
Twitter: @gyubok
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Change display format of DateTimePicker

at some time i'll have to create custom date pickers as well, not really looking forward to it. maybe 10.2 will bring something, but i guess it's all up to yourself on that.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 403
Registered: ‎04-04-2012
My Device: BlackBerry Z30/Z10/Z10LE/Q10/PlayBook

Re: Change display format of DateTimePicker

@gyubok. The date should only be dependant on the region settings. The documentation for DateTimePicker shows yyyy-mm-dd as possible so this is a region setting problem.

 

https://developer.blackberry.com/cascades/reference/bb__cascades__datetimepicker.html