Skip to content

Accept countdown target dates in the user's locale#151

Merged
danielchalmers merged 2 commits into
masterfrom
fix/countdown-target-culture
Jul 11, 2026
Merged

Accept countdown target dates in the user's locale#151
danielchalmers merged 2 commits into
masterfrom
fix/countdown-target-culture

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Jul 11, 2026

Copy link
Copy Markdown
Owner

The countdown Custom target text box binds a DateTime with no ConverterCulture, so WPF uses the element's Language — which defaults to en-US for every WPF element regardless of the OS locale. A German or French user who types a date in their own format (e.g. 25.12.2026 18:00) gets it silently rejected on focus loss: no error, the value just doesn't change.

It's made worse by the surrounding UI: the preset captions ("Sat, Jul 12, 9:00 AM") and the plain-words preview below the box both render in the OS locale, so the user is shown dates in exactly the format the box refuses to parse.

Fixed by setting the editor's Language from CultureInfo.CurrentCulture in the constructor. Because Language inherits down the visual tree, the target text box now parses and displays dates in the user's locale, consistent with the captions and preview. On an en-US machine nothing changes.

The target text box used WPF's default en-US element language for its
date conversion, so a non-US user typing a date in their own format (e.g.
25.12.2026) had it silently rejected on focus loss - while the preset
captions and preview right beside it render dates in the OS locale, teaching
exactly the format the box wouldn't accept. Set the editor's Language from
the current culture so input and display match the rest of the UI.
@github-actions github-actions Bot added the bug Something isn't working label Jul 11, 2026
@danielchalmers
danielchalmers requested a review from Copilot July 11, 2026 12:37

This comment was marked as outdated.

The initial binding transfer happens at load time so the display was
already correct, but ordering the Language assignment before
InitializeComponent means correctness doesn't depend on that timing.
@danielchalmers
danielchalmers merged commit c683bc3 into master Jul 11, 2026
4 checks passed
@danielchalmers
danielchalmers deleted the fix/countdown-target-culture branch July 11, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants