From 4ae2ea32e9e2dd95b76095b17f98fa90e1d3304f Mon Sep 17 00:00:00 2001 From: d11n Date: Thu, 13 Oct 2022 09:29:30 +0200 Subject: [PATCH] UI: Fix missing timezone in browser dates (#4210) Fix for an issue brought up by @petzsch in todays dev meeting. --- BTCPayServer.Abstractions/Extensions/ViewsRazor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs b/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs index 7600efe63..468146070 100644 --- a/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs +++ b/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs @@ -96,7 +96,7 @@ namespace BTCPayServer.Abstractions.Extensions { var relative = date.ToTimeAgo(); var initial = format.ToString().ToLower(); - var dateTime = date.ToString("s", CultureInfo.InvariantCulture); + var dateTime = date.ToString("o", CultureInfo.InvariantCulture); var displayDate = format == DateDisplayFormat.Relative ? relative : date.ToString("g", CultureInfo.InvariantCulture); return new HtmlString($""); } @@ -105,7 +105,7 @@ namespace BTCPayServer.Abstractions.Extensions { var relative = date.ToTimeAgo(); var initial = format.ToString().ToLower(); - var dateTime = date.ToString("s", CultureInfo.InvariantCulture); + var dateTime = date.ToString("o", CultureInfo.InvariantCulture); var displayDate = format == DateDisplayFormat.Relative ? relative : date.ToString("g", CultureInfo.InvariantCulture); return new HtmlString($""); }