From 29503e103bddef342d4c26c2898148b9ba08fa28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Pilgaard=20Gr=C3=B8ndahl?= Date: Fri, 1 Sep 2023 22:36:06 +0200 Subject: [PATCH] fixed pluralization issue with datetime to text --- src/web/Client/Extensions/DateTimeExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/Client/Extensions/DateTimeExtensions.cs b/src/web/Client/Extensions/DateTimeExtensions.cs index 8aa40976..19d633a7 100644 --- a/src/web/Client/Extensions/DateTimeExtensions.cs +++ b/src/web/Client/Extensions/DateTimeExtensions.cs @@ -21,7 +21,7 @@ public static string DisplayTimePassed(this DateTime date) switch (timeSpan.TotalMinutes) { - case 1: + case < 2: return $"sendt for 1 minut siden"; case < 60: return $"sendt for {Math.Floor(timeSpan.TotalMinutes)} minutter siden"; @@ -29,7 +29,7 @@ public static string DisplayTimePassed(this DateTime date) switch (timeSpan.TotalHours) { - case 1: + case < 2: return $"sendt for 1 time siden"; case < 24: return $"sendt for {Math.Floor(timeSpan.TotalHours)} timer siden"; @@ -37,7 +37,7 @@ public static string DisplayTimePassed(this DateTime date) switch (timeSpan.TotalDays) { - case 1: + case < 2: return "sendt igår"; case < 7: return $"sendt for {Math.Floor(timeSpan.TotalDays)} dage siden";