Skip to content

Comments

Add options for setting format strings of date and time#272

Open
jameson0496 wants to merge 1 commit intojrpie:masterfrom
jameson0496:features/date-time-format
Open

Add options for setting format strings of date and time#272
jameson0496 wants to merge 1 commit intojrpie:masterfrom
jameson0496:features/date-time-format

Conversation

@jameson0496
Copy link

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.

@jrpie
Copy link
Owner

jrpie commented Feb 10, 2026

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.
(I think there is a problem with AM/PM vs 24h; that's a separate problem). I don't really understand why someone would want to use a format that is neither ISO8601 nor the format matching their locale. (To be fair, I don't really understand why anywould would want to use anything but ISO8601... 😅)
What is the reason why you would like to have this option?

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.).
Also in you suggested implementation, the localized date format setting and the format string interact in a weird and confusing way. If this feature is added - which needs proper justification - I think the following options would be prefereable:

  • Instead of the "use localized date format" toggle, provide a setting with three option, ISO8601, localized and custom. For the first two use a toggle for settings, for the latter use format strings provided by the user.
  • Add a second clock widget. (I'm not too happy that the clock configuration is global, but there can be multiple clock widgets. On the other hand, adding those option to the clock widget would make it quite hard to find).

@jameson0496
Copy link
Author

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.

@jrpie
Copy link
Owner

jrpie commented Feb 15, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants