You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dates in the Notes/Agenda/Reminders window were hardcoded to dd/MM/yyyy HH:mm, which doesn't match users whose OS region uses a different short-date format (e.g. yyyy-MM-dd).
main.py now calls locale.setlocale(LC_TIME, "") once at startup so strftime("%x") / strftime("%X") follow the OS region settings.
Notes/Agenda/Reminders cards now render dates via a small _format_dt_os helper that uses %x %X and strips seconds (the original UI didn't show them).
Test plan
Launch the app, open the Notes window
Verify each tab (Notes, Agenda, Reminders) renders dates in your OS short-date format
Verify times render without seconds
Change OS region settings (e.g. to a different short-date pattern), restart, confirm formatting follows
Thanks for the PR! Locale-aware date formatting is a nice improvement, definitely better than hardcoded %d/%m/%Y for everyone.
I have a couple of concerns before merging though:
1. locale.setlocale() is not thread-safe
WritHer runs multiple threads (dictation worker, assistant worker, hotkey listener, reminder scheduler). Python's docs explicitly warn that setlocale() affects the entire process and is not safe to call in multi-threaded applications. This could cause intermittent crashes or garbled output that's very hard to reproduce.
2. Conflicts with the existing i18n system
WritHer already has config.LANGUAGE + locales.py to control the user-facing language. Using the OS locale introduces a second, independent source of truth. A user with Windows set to English but WritHer set to Italian would see dates formatted in English inside the Notes window, that's inconsistent.
3. setlocale() in main.py is a side-effect in the wrong place
main.py doesn't do any date formatting itself. The locale call there is a global side-effect that affects the whole process just to serve notes_window.py. That's fragile.
What I'd suggest instead
Remove locale.setlocale() entirely, don't touch the global locale
Keep the formatting logic local to notes_window.py (where it's actually used)
Base the date format on config.LANGUAGE instead of the OS locale
Something simple like:
def_format_dt(dt: datetime) ->str:
ifconfig.LANGUAGE=="it":
returndt.strftime("%d/%m/%Y %H:%M")
returndt.strftime("%Y-%m-%d %H:%M") # ISO-ish for EN and others
This stays consistent with the rest of the app, is thread-safe, and easy to extend when new languages are added.
The seconds-stripping logic is fine to keep, I agree that seconds are noise in this UI.
Would you be okay reworking it along these lines? Happy to help if you have questions. Thanks again for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dd/MM/yyyy HH:mm, which doesn't match users whose OS region uses a different short-date format (e.g.yyyy-MM-dd).main.pynow callslocale.setlocale(LC_TIME, "")once at startup sostrftime("%x")/strftime("%X")follow the OS region settings._format_dt_oshelper that uses%x %Xand strips seconds (the original UI didn't show them).Test plan