Skip to content

Commit 09b77f1

Browse files
authored
Fix: Fixed issue with some date formats not reflecting language settings (#12492)
1 parent 1b24eb0 commit 09b77f1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Files.App/ServicesImplementation/DateTimeFormatter/ApplicationDateTimeFormatter.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ public override string ToLongLabel(DateTimeOffset offset)
4343
if (offset.Year is <= 1601 or >= 9999)
4444
return " ";
4545

46-
var localTime = offset.ToLocalTime();
47-
4846
if (elapsed.TotalDays < 7 && elapsed.TotalSeconds >= 0)
49-
return $"{localTime:D} {localTime:t} ({ToShortLabel(offset)})";
47+
return $"{ToString(offset, "D")} {ToString(offset, "t")} ({ToShortLabel(offset)})";
5048

51-
return $"{localTime:D} {localTime:t}";
49+
return $"{ToString(offset, "D")} {ToString(offset, "t")}";
5250
}
5351
}
5452
}

0 commit comments

Comments
 (0)