From 5bfc15d87ff5ccf8e72f1fe57859e733359ac727 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:06:46 -0500 Subject: [PATCH 1/2] Use locale-aware date/time formatting throughout UI (#41) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded US-style date formats (MM/dd, MMM d, h:mm tt) with the "g" general format specifier which respects the user's system locale. Dashboard: - ServerConnectionStatus: "Checked" and "Online since" timestamps - ManageServersWindow: Last Connected column - CollectorScheduleWindow: Last Run and Next Run columns Lite: - ServerConnectionStatus: same "Checked" and "Online since" timestamps - CollectorHealthRow/CollectionLogRow: all formatted timestamp properties Does not change the time range picker (AM/PM hour list) — that needs a separate design discussion. Co-Authored-By: Claude Opus 4.6 --- Dashboard/CollectorScheduleWindow.xaml | 4 ++-- Dashboard/ManageServersWindow.xaml | 2 +- Dashboard/Models/ServerConnectionStatus.cs | 5 ++--- Lite/Models/ServerConnectionStatus.cs | 5 ++--- Lite/Services/LocalDataService.CollectionHealth.cs | 8 ++++---- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Dashboard/CollectorScheduleWindow.xaml b/Dashboard/CollectorScheduleWindow.xaml index e002f72d..ee370e21 100644 --- a/Dashboard/CollectorScheduleWindow.xaml +++ b/Dashboard/CollectorScheduleWindow.xaml @@ -40,8 +40,8 @@ - - + + diff --git a/Dashboard/ManageServersWindow.xaml b/Dashboard/ManageServersWindow.xaml index 8f83ad24..9c279c8c 100644 --- a/Dashboard/ManageServersWindow.xaml +++ b/Dashboard/ManageServersWindow.xaml @@ -50,7 +50,7 @@ - + diff --git a/Dashboard/Models/ServerConnectionStatus.cs b/Dashboard/Models/ServerConnectionStatus.cs index 15f84571..5000dd14 100644 --- a/Dashboard/Models/ServerConnectionStatus.cs +++ b/Dashboard/Models/ServerConnectionStatus.cs @@ -7,7 +7,6 @@ */ using System; -using System.Globalization; namespace PerformanceMonitorDashboard.Models { @@ -127,7 +126,7 @@ public string LastCheckedDisplay if (elapsed.TotalHours < 24) return $"Checked {(int)elapsed.TotalHours}h ago"; - return $"Checked {LastChecked.Value.ToString("MMM d, h:mm tt", CultureInfo.CurrentCulture)}"; + return $"Checked {LastChecked.Value.ToString("g")}"; } } @@ -147,7 +146,7 @@ public string StatusDurationDisplay { if (ServerStartTime.HasValue) { - return $"Online since {ServerStartTime.Value.ToString("MMM d, h:mm tt", CultureInfo.CurrentCulture)}"; + return $"Online since {ServerStartTime.Value.ToString("g")}"; } return "Online"; } diff --git a/Lite/Models/ServerConnectionStatus.cs b/Lite/Models/ServerConnectionStatus.cs index 16977173..3bb56012 100644 --- a/Lite/Models/ServerConnectionStatus.cs +++ b/Lite/Models/ServerConnectionStatus.cs @@ -7,7 +7,6 @@ */ using System; -using System.Globalization; namespace PerformanceMonitorLite.Models; @@ -146,7 +145,7 @@ public string LastCheckedDisplay if (elapsed.TotalHours < 24) return $"Checked {(int)elapsed.TotalHours}h ago"; - return $"Checked {LastChecked.Value.ToString("MMM d, h:mm tt", CultureInfo.CurrentCulture)}"; + return $"Checked {LastChecked.Value.ToString("g")}"; } } @@ -166,7 +165,7 @@ public string StatusDurationDisplay { if (ServerStartTime.HasValue) { - return $"Online since {ServerStartTime.Value.ToString("MMM d, h:mm tt", CultureInfo.CurrentCulture)}"; + return $"Online since {ServerStartTime.Value.ToString("g")}"; } return "Online"; } diff --git a/Lite/Services/LocalDataService.CollectionHealth.cs b/Lite/Services/LocalDataService.CollectionHealth.cs index c30557cf..8a5da51a 100644 --- a/Lite/Services/LocalDataService.CollectionHealth.cs +++ b/Lite/Services/LocalDataService.CollectionHealth.cs @@ -122,7 +122,7 @@ public class CollectionLogRow public string Status { get; set; } = ""; public string? ErrorMessage { get; set; } - public string CollectionTimeFormatted => CollectionTime.ToLocalTime().ToString("MM/dd HH:mm:ss"); + public string CollectionTimeFormatted => CollectionTime.ToLocalTime().ToString("g"); public string DurationFormatted => DurationMs.HasValue ? (DurationMs.Value < 1000 ? $"{DurationMs.Value} ms" : $"{DurationMs.Value / 1000.0:F1} s") @@ -167,15 +167,15 @@ public string HealthStatus : $"{AvgDurationMs / 1000:F1} s"; public string LastSuccessFormatted => LastSuccessTime.HasValue - ? LastSuccessTime.Value.ToLocalTime().ToString("MM/dd HH:mm:ss") + ? LastSuccessTime.Value.ToLocalTime().ToString("g") : "Never"; public string LastRunFormatted => LastRunTime.HasValue - ? LastRunTime.Value.ToLocalTime().ToString("MM/dd HH:mm:ss") + ? LastRunTime.Value.ToLocalTime().ToString("g") : "Never"; public string LastErrorFormatted => LastErrorTime.HasValue - ? LastErrorTime.Value.ToLocalTime().ToString("MM/dd HH:mm:ss") + ? LastErrorTime.Value.ToLocalTime().ToString("g") : ""; } From f132193936251c3ffff7d2ff2eefc48981e9b50f Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:13:43 -0500 Subject: [PATCH 2/2] Switch time range picker to 24-hour format in both apps Change hour picker from "12 AM", "1 AM", ... "11 PM" to "00:00", "01:00", ... "23:00". Consistent with chart axis labels, SQL Server log conventions, and international users. Parse logic is index-based (SelectedIndex 0-23) so no functional change. Co-Authored-By: Claude Opus 4.6 --- Dashboard/ServerTab.xaml.cs | 2 +- Lite/Controls/ServerTab.xaml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dashboard/ServerTab.xaml.cs b/Dashboard/ServerTab.xaml.cs index 1d54bc03..3bff0a9d 100644 --- a/Dashboard/ServerTab.xaml.cs +++ b/Dashboard/ServerTab.xaml.cs @@ -172,7 +172,7 @@ private void InitializeTimeComboBoxes() for (int h = 0; h < 24; h++) { var dt = DateTime.Today.AddHours(h); - hours.Add(dt.ToString("h tt")); // "12 AM", "1 AM", ..., "11 PM" + hours.Add(dt.ToString("HH:00")); // "00:00", "01:00", ..., "23:00" } GlobalFromHour.ItemsSource = hours; diff --git a/Lite/Controls/ServerTab.xaml.cs b/Lite/Controls/ServerTab.xaml.cs index 4e30cdae..40f7877a 100644 --- a/Lite/Controls/ServerTab.xaml.cs +++ b/Lite/Controls/ServerTab.xaml.cs @@ -144,7 +144,7 @@ private void InitializeTimeComboBoxes() for (int h = 0; h < 24; h++) { var dt = DateTime.Today.AddHours(h); - hours.Add(dt.ToString("h tt")); // "12 AM", "1 AM", ..., "11 PM" + hours.Add(dt.ToString("HH:00")); // "00:00", "01:00", ..., "23:00" } FromHourCombo.ItemsSource = hours;