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

Web and WebWorks Development

New Contributor
Posts: 6
Registered: ‎12-04-2012
My Device: BB10 Dev Alpha
My Carrier: Developer

Formatting datetime-local in BB10

Hello. I'm using a datetime-local field in one my screens.


The first problem is that if I want to dinamically set a date in that field, the only way I found is to set the value of the input field in this weird format: 2012-12-01T10:15. All other formats (like 01/12/2012 10:15) seem to be not accepted. Is this the way it is supposed to work? Am I doing it correctly?


The second problem is that setting the date in such weird format will display the date in that format as well. Is there a way to at least show the date in a pretty human-readable way?


Thanks in advance.


--------------------- Snippet of my sceen --------------------------


<input type="datetime-local" id="departureDate" />




--------------------- Snippet of the code I use for setting the date --------------------------


element.getElementById('departureDate').value = "2012-12-01T10:15"