Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DesktopClock/CountdownTargetEditor.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using DesktopClock.Properties;
using Humanizer;

Expand All @@ -25,6 +27,9 @@ private static readonly (string Name, Func<DateTime> GetTarget)[] Presets =

public CountdownTargetEditor()
{
// WPF defaults every element's Language to en-US, so the target text box would parse and show dates only in US format. Follow the OS locale instead, matching the preset captions and preview below it. Set before InitializeComponent so the culture is already in place when the bindings are created.
Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);

InitializeComponent();

Loaded += CountdownTargetEditor_Loaded;
Expand Down