Caleb Nasio
Caleb Nasio

Reputation: 61

Codename one Picker change date format

Is it possible to change the date format on the codename one Picker to show only the year in full e.g 2014 or 1990 ? As of now it has this date format "M/d/yy" which in turn gives a date such as "Oct 15 2014" to "10/15/14". Is there a way to change this date format?

Upvotes: 0

Views: 753

Answers (2)

Aiden
Aiden

Reputation: 335

In case anyone is still looking, The Picker has a getDate(), with this you can use the CNILIB on formating.

String datestring=(new SimpleDateFormat("yyyy-MM-dd")).format(picker.getDate())

Upvotes: 0

Shai Almog
Shai Almog

Reputation: 52770

This looks differently on the devices. The picker is implemented natively there.

Upvotes: 0

Related Questions