I want to show the name of the month in a recycler view, but I can't find the Locale.SPAIN option, and I have to show it in English. this is the adapter command that has to show the month:
holder.toma.setText("Mes: "+ getMonthName(listDatos.get(position).getMes(), Locale.US, false));
and this is the getMonthName function:
private String getMonthName(final int index, final Locale locale, final boolean shortName)
{
String format = "%tB";
if (shortName)
format = "%tb";
Calendar calendar = Calendar.getInstance(locale);
calendar.set(Calendar.MONTH, index);
calendar.set(Calendar.DAY_OF_MONTH, 1);
return String.format(locale, format, calendar);
}