Skip to content

Commit

Permalink
[WinUI] Fix DateTimeFormatter for "ddd" (#20045)
Browse files Browse the repository at this point in the history
* Update ddd DateTimeFormatter

* Update test
  • Loading branch information
drasticactions authored Jun 8, 2024
1 parent e94b364 commit 4480349
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Compatibility/Core/src/Windows/DatePickerRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void UpdateDay()
if (day == 0)
Control.DayVisible = false;
else if (day == 3)
Control.DayFormat = "day dayofweek.abbreviated";
Control.DayFormat = "dayofweek.abbreviated";
else if (day == 4)
Control.DayFormat = "dayofweek.full";
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ internal static string GetDayFormat(string format)
var day = format.Count(x => x == 'd');

if (day == 3)
return "{day.integer} {dayofweek.abbreviated}";
return "{dayofweek.abbreviated}";
else if (day == 4)
return "{dayofweek.full}";
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override async Task DisconnectHandlerDoesntCrash()
[Theory(DisplayName = "Format Initializes Correctly")]
[InlineData("dd/MM/yyyy", "{day.integer(2)}/{month.integer(2)}/{year.full}")]
[InlineData("d/M/yy", "{day.integer}/{month.integer(1)}/{year.abbreviated}")]
[InlineData("ddd/MMM/yyyy", "{day.integer} {dayofweek.abbreviated}/{month.abbreviated}/{year.full}")]
[InlineData("ddd/MMM/yyyy", "{dayofweek.abbreviated}/{month.abbreviated}/{year.full}")]
[InlineData("dddd/MMMM/yyyy", "{dayofweek.full}/{month.full}/{year.full}")]
public async Task FormatInitializesCorrectly(string format, string nativeFormat)
{
Expand Down

0 comments on commit 4480349

Please sign in to comment.