microsoft / microsoft/microsoft-ui-xaml

Wrong Regional Formatting on CalendarDatePicker in packaged app vs unpackaged AppSDK 1.6

Open
#10,012 0 comments 0 reactions 0 assignees View on GitHub
area-DateTimePickers area-Unpackaged bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

After upgrading to AppSDK 1.6, I found that CalendarDatePicker is now correctly rendering dates according to region settings, but only in an unpackaged app.
In a Packaged app, the regional formatting is incorrectly being pulled from the UI display language, rather than the regional setting.

- System language is `English (United States)`
- Country/Region is `United States`
- Regional settings are `German (Germany)`
- I've overridden the short date format to `YYYY-MM-dd`
![image](https://github.com/user-attachments/assets/53f08712-39a9-482c-adec-83537437c4ae)

In a sample app with only a ``, I see different results when running the app packaged vs unpackaged:

Unpackaged (correct):
![image](https://github.com/user-attachments/assets/604ad2ed-4879-4799-b527-1e9765e2c98e)

Packaged (incorrect):
![image](https://github.com/user-attachments/assets/d97b003a-4e6d-48d0-be91-cf470a2c4854)

You can see this incorrect behaviour in the Gallery app, as well
I can reproduce this behaviour both on Windows 10 and Windows 11

### Steps to reproduce the bug

Create a CalendarDatePicker

### Expected behavior

The picker should display dates in the user's regional formatting (`YYYY-MM-dd` in this case), whether packaged or unpackaged

### Screenshots

Unpackaged (correct):
![image](https://github.com/user-attachments/assets/604ad2ed-4879-4799-b527-1e9765e2c98e)

Packaged (incorrect):
![image](https://github.com/user-attachments/assets/d97b003a-4e6d-48d0-be91-cf470a2c4854)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.0: 1.6.240829007

### Windows version

Windows 11 (22H2): Build 22621, Windows 10 (21H2): Build 19044

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the CalendarDatePicker behavior in the Windows App SDK 1.6 sample described in the issue, reproducing it in both packaged and unpackaged configurations. Compare the regional formatting results against the stated Windows regional settings; done means both configurations display the overridden YYYY-MM-dd format rather than the UI display language format.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.