Closed kartikg3 closed 1 year ago
Just tested this on Android version 13 and it worked as expected.
This is reproducible when setting the main language to English (Canada). It does not happen with English (United States) or English (United Kingdom).
Works as expected:
DateFormat twelveHourFormat = new SimpleDateFormat("h:mm a", Locale.US);
twelveHourFormat.parse("8:00 PM");
Throws ParseException
, fallbacks to 24h format:
DateFormat twelveHourFormat = new SimpleDateFormat("h:mm a", Locale.CANADA);
twelveHourFormat.parse("8:00 PM");
@jorpaspr Thank you for the info! Everything makes sense now! What a strange issue and compounded by the fact that I cannot get my physical test device nor my emulator to switch to the Canada locale. I've set the timezone manually in both to Canada and Eastern time zone, but the locale still comes back as en_US
so I have not been able to test the parse exception directly.
I've created a branch for the fix here: https://github.com/nutritionfactsorg/daily-dozen-android/pull/233
@kartikg3 @jorpaspr Would either of you be willing to test an apk with the above fix to confirm that it works on an actual device?
@slavick This works. I've left a suggestion on the PR as I think it can be improved.
Fix for this bug released in v23.1
https://github.com/nutritionfactsorg/daily-dozen-android/releases/tag/v23.1
Same issue as https://github.com/nutritionfactsorg/daily-dozen-android/issues/171
I now have the latest Pixel 6 (Android version 12). Transferred over the data from my LG G6 into a new installation of the app on the Pixel 6, and I still see this issue. I get the reminder at 8 AM in the morning, even if the app shows that it has been set for 8 PM. I am in Canada (EDT) Eastern timezone, if that helps troubleshooting this.