From c5858a0aa4d28b02e5089d1c5491ba11f68f6019 Mon Sep 17 00:00:00 2001 From: Henning Normann Date: Tue, 1 Oct 2024 13:20:45 +0200 Subject: [PATCH] Invoked DateTime.ToString() with CultureInvariant --- .../Controllers/MessageboxInstancesController.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Storage/Controllers/MessageboxInstancesController.cs b/src/Storage/Controllers/MessageboxInstancesController.cs index bc14591e..9b90d106 100644 --- a/src/Storage/Controllers/MessageboxInstancesController.cs +++ b/src/Storage/Controllers/MessageboxInstancesController.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text.Json; using System.Threading.Tasks; @@ -409,35 +410,35 @@ private static InstanceQueryParameters GetQueryParams(MessageBoxQueryModel query if (queryModel.FromLastChanged != null) { - queryParams.LastChanged = $"gte:{queryModel.FromLastChanged?.ToString(dateTimeFormat)}"; + queryParams.LastChanged = $"gte:{queryModel.FromLastChanged?.ToString(dateTimeFormat, CultureInfo.InvariantCulture)}"; } if (queryModel.ToLastChanged != null) { if (string.IsNullOrEmpty(queryParams.LastChanged)) { - queryParams.LastChanged = $"lte:{queryModel.ToLastChanged?.ToString(dateTimeFormat)}"; + queryParams.LastChanged = $"lte:{queryModel.ToLastChanged?.ToString(dateTimeFormat, CultureInfo.InvariantCulture)}"; } else { - queryParams.LastChanged = string.Concat(queryParams.LastChanged, $"lte:{queryModel.ToLastChanged?.ToString(dateTimeFormat)}"); + queryParams.LastChanged = string.Concat(queryParams.LastChanged, $"lte:{queryModel.ToLastChanged?.ToString(dateTimeFormat, CultureInfo.InvariantCulture)}"); } } if (queryModel.FromCreated != null) { - queryParams.MsgBoxInterval = [$"gte:{queryModel.FromCreated?.ToString(dateTimeFormat)}"]; + queryParams.MsgBoxInterval = [$"gte:{queryModel.FromCreated?.ToString(dateTimeFormat, CultureInfo.InvariantCulture)}"]; } if (queryModel.ToCreated != null) { if (queryParams.MsgBoxInterval == null || queryParams.MsgBoxInterval.Length == 0) { - queryParams.MsgBoxInterval = [$"lte:{queryModel.ToCreated?.ToString(dateTimeFormat)}"]; + queryParams.MsgBoxInterval = [$"lte:{queryModel.ToCreated?.ToString(dateTimeFormat, CultureInfo.InvariantCulture)}"]; } else { - queryParams.MsgBoxInterval = queryParams.MsgBoxInterval.Concat([$"lte:{queryModel.ToCreated?.ToString(dateTimeFormat)}"]).ToArray(); + queryParams.MsgBoxInterval = queryParams.MsgBoxInterval.Concat([$"lte:{queryModel.ToCreated?.ToString(dateTimeFormat, CultureInfo.InvariantCulture)}"]).ToArray(); } }