prolificinteractive / material-calendarview

A Material design back port of Android's CalendarView
https://prolificinteractive.github.io/material-calendarview/
MIT License
5.91k stars 1.32k forks source link

Heads up: desugaring has an issue #1094

Open tylerwilson opened 3 years ago

tylerwilson commented 3 years ago

Good day, just an informational note here. I have been using this library for a while. I wanted to update my Android app to use the new feature in Google Android desugaring, as mentioned in the threetenbp repo. I found this fork that had already done the work here.

Then I tested on an Android 5 / API 21 device, and noted the title was "2 2021" instead of "February 2021". Looking around the web, I found these two Google issues:

https://issuetracker.google.com/issues/157926127 https://issuetracker.google.com/issues/160113376

The first says, it is as designed. The second is a feature request to add support for the LLLL format.

To work around it in my app, I simply do this:

widget.setTitleFormatter { day -> DateTimeFormatter.ofPattern("MMMM yyyy").format(day.date) }

I don't expect you to change it to MMMM in the lib, since it appears this is the right way to do it in this case. Just wanted to post this in case others have the same issue.