Futsch1 / medTimer

MedTimer Android app
MIT License
101 stars 11 forks source link

Allow users to select date time formats #298

Open Blend3rman opened 1 day ago

Blend3rman commented 1 day ago

Is your feature request related to a problem? Please describe. I'd like to be able to select my preferred date and time formats that reminders get displayed in, on the Overview page.

Describe the solution you'd like I've taken a peek at the codebase, and the current implementation reads the locale user config. Which makes sense usually, but in my personal use case I've set my device locale to the US for use in other apps. However, I'd prefer my dates in DD/MM/YY format.

I'd appreciate guidance on how to add a new shared preference that shows up in the Settings menu, and any localization to-dos I need to be aware of. Also let me know if this feature doesn't make sense to pursue.

Futsch1 commented 15 hours ago

What would be much easier is not to change the overall date format, but just use the medium length date representation instead of the short one as a configuration option (so use https://developer.android.com/reference/android/text/format/DateFormat#getMediumDateFormat(android.content.Context) instead of the default short length representation.

This would imply changes only in TimeHelper.java and in the preferences. Care needs to be taken that it is not only about formatting dates, but that parsing dates is also affected (e.g. when setting cyclic reminder start dates and editing events).

The settings menu is controlled via res/xml/root_preferences.xml. Localization needs to be added for all languages.