Skip to content

Commit

Permalink
fixed pluralization issue with datetime to text
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Sep 1, 2023
1 parent 2aeba3c commit 29503e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/web/Client/Extensions/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ 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";
}

switch (timeSpan.TotalHours)
{
case 1:
case < 2:
return $"sendt for 1 time siden";
case < 24:
return $"sendt for {Math.Floor(timeSpan.TotalHours)} timer siden";
}

switch (timeSpan.TotalDays)
{
case 1:
case < 2:
return "sendt igår";
case < 7:
return $"sendt for {Math.Floor(timeSpan.TotalDays)} dage siden";
Expand Down

0 comments on commit 29503e1

Please sign in to comment.