How can i convert Date
to Ukrainian language dynamically.
I'm using this code:
final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM, yyyy");
final Date date = calendar.getTime();
final TextView chosenMonth = (TextView) findViewById(R.id.chosenMonth);
chosenMonth.setText(dateFormat.format(date));
To format date as "September, 2013". This text language is Device language, but i need to format this date and display only in Ukrainian language.
I tried to implement this using Locale
class but there is no constant for UA language.
Although there is no constant, you can still set the locale yourself if its supported on your device. Refer to this list of supported locales by Android version.
Create your Ukranian Locale with new Locale('uk','UA')
and then use it in the version of SimpleDateFormat that takes a Locale.
Would this work?
final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM, yyyy", new Locale('uk','UA'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With