andstatus / todoagenda

Android home screen widgets showing future (and past) calendar events and tasks
Apache License 2.0
130 stars 19 forks source link

SimpleDateFormat limitations #147

Open JohnVeness opened 3 months ago

JohnVeness commented 3 months ago

Hi. I have set my "Day header date format" to "EEE d MMM". This produces dates like "Sun 11 Aug". This mostly works fine, other than dates in September which show like "Mon 9 Sept" not "Mon 9 Sep" as I'd expect.

Searching around this seems to be a problem with the old SimpleDateFormat API and the advice appears to be to change to the more modern java.time API. Is this possible?

Thanks for reading, and for this widget, which I have used for many years :)

yvolk commented 1 week ago

Hello @JohnVeness! Yes, I see that DateTimeFormatter is described as a newer solution... https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/format/DateTimeFormatter.html And I see that the migration is not trivial, see e.g. https://stackoverflow.com/questions/53830321/dateformat-to-datetimeformatter?noredirect=1&lq=1 So we will need extensive testing (and probably writing new unit tests...), including different locales...

Making this change just for one small case looks like overkill, but you could volunteer to make this change :-)

JohnVeness commented 1 week ago

Thanks for looking into this! I think implementing this is beyond my skills, though.