hugomfandrade / CalendarView-Widget

📅 CalendarView-Widget is an Android library that allows you to customize and display a calendar and an overview of its events
MIT License
27 stars 14 forks source link

Single-Letter Abbreviations for Days #11

Closed emm-an-uel closed 1 year ago

emm-an-uel commented 1 year ago

Hey hugo, I like what you've provided with this calendar view widget but I was just hoping there was a way I could replace the names of the days of the week (on top of the calendar view) with single-letter abbreviations instead? ie Monday would be M, Tuesday would be T etc. Is there a way I could do this? Cheers

hugomfandrade commented 1 year ago

Hi, unfortunately I did not provide this as an option in the form of an attribute. However, if you could alter the code, I would suggest you look at line 336 of the CalendarView.java file, where you can find the line "weekHeaderTexts[i] = simpleText(new DateFormatSymbols().getWeekdays()[dayIndex]);"

calling the 'substring' method could be enough "weekHeaderTexts[i] = simpleText(new DateFormatSymbols().getWeekdays()[dayIndex]).substring(0, 1);"

emm-an-uel commented 1 year ago

cheers, I'll try that out