Add options for setting format strings of date and time#272
Add options for setting format strings of date and time#272jameson0496 wants to merge 1 commit intojrpie:masterfrom
Conversation
|
Thanks for contributing! However, this feature was already discussed (see e.g. #12) and I decided not to implement it. The current implementation allows for ISO8601 - this international standard - as well as the date format matching the language setting of the device. Moreover, assuming there is a reason why this feature is needed, I think the seconds setting should still be accessible to users not knowing about format strings (date/time format string differ everywhere, you need to read the documentation, etc.).
|
|
I tried searching through past issues/PRs to see if this had been discussed before but I missed the one you linked. On my device (Google Pixel 5) the localized format does change the date to 02/10/2026 from the ISO standard, however the time is not changed from 24hr to 12hr (I can see in the code something about 12 vs 24 hour, but did not investigate). I wanted the feature in this PR to be able to change the format myself (remove padded zeros and set 12hr time with AM/PM), and set a custom date format (e.g. February 10, 2026). I like your idea of a toggle between ISO8601, localized, and custom. That is a much better implementation than what I planned, as it would allow "advanced users" to use custom strings if desired but also leave the settings accessible to users who do not wish to learn format strings (they can be very confusing). The method of setting options in the widget would also be useful, however that is likely beyond my programming skill level currently. As far as I can tell the widget does not have a configuration menu (if it does I cannot find it) so that would have to be added. Thank you for your detailed response. I switched to this launcher after the popular one I was using chose to include popup ads (😢), and so far this one is my favorite out of the ones I have tried. The only issue I had was with using 12hr time (no matter how hard I have tried, my brain will not switch to 24hr), the custom date format is not essential for me (but nice to have). If it would be useful, I will see if I can figure out such a toggle option and add that to this PR instead (or create a new PR if that would be better). Thank you. |
|
I fixed the AM/PM problem in 5e0da39, when using the localized date format option the app should now automatically select 24h or am/pm correctly. |
Currently the only options to change the format of date and time are "set localized date and time" and "show seconds." This PR adds two options "date-format" and "time-format" which replace the default dateFMT = "yyyy-MM-dd" and timeFMT = "HH:mm" strings, allowing the user to customize the UI further.
This PR also invalidates the "show seconds" option (this functionality would now be done by appending ":ss" or similar to time-format option), so I have "soft removed" it from the options menu, but it is still in the code.
If this PR is going to be merged, I will make another commit updating the documentation files accordingly.
This is my first time doing a PR through GitHub, so let me know if I completely messed something up :)
Thank you.