By default onSelectedDayChange() of calendarView diplay's month as an integer value like:- 1-1-2021. But I want the format as 1-Jan-2021. Please help out.
Thanks in Advance!!
By default onSelectedDayChange() of calendarView diplay's month as an integer value like:- 1-1-2021. But I want the format as 1-Jan-2021. Please help out.
Thanks in Advance!!
you can use the DateFormatSymbols class and get the list of months in String
calendarView.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
@Override
public void onSelectedDayChange(@NonNull CalendarView view, int year, int month, int dayOfMonth) {
DateFormatSymbols dateFormatSymbols = new DateFormatSymbols();
String mMonth = dateFormatSymbols.getMonths()[month - 1];
}
});