Skip to content

Fix date format string to ignore per-user Windows regional overrides#62

Merged
albertospelta merged 1 commit into
mainfrom
alberto/fix-test
Jul 14, 2026
Merged

Fix date format string to ignore per-user Windows regional overrides#62
albertospelta merged 1 commit into
mainfrom
alberto/fix-test

Conversation

@albertospelta

Copy link
Copy Markdown
Member

BaseDateTemplate.GetDefaultFormatString built the default DateTime formatString via new CultureInfo(isoCulture).DateTimeFormat.ShortDatePattern. That constructor defaults to useUserOverride: true, so on a machine where the Windows user has customized Control Panel > Region short-date format (even under a plain "en-US" locale), the emitted formatString silently changes with it - e.g. "yyyy-mm-dd" instead of the culture-defined "m/d/yyyy". This made generated templates non-reproducible across machines and was the actual cause of the StandardConfig_OfflineApply_MatchesSnapshot and CalendarStandardConfig_MatchesSnapshot golden-file failures. Pass useUserOverride: false so the format string depends only on the configured culture, not on the building machine's personal preferences.

BaseDateTemplate.GetDefaultFormatString built the default DateTime formatString via new CultureInfo(isoCulture).DateTimeFormat.ShortDatePattern. That constructor defaults to useUserOverride: true, so on a machine where the Windows user has customized Control Panel > Region short-date format (even under a plain "en-US" locale), the emitted formatString silently changes with it - e.g. "yyyy-mm-dd" instead of the culture-defined "m/d/yyyy".  This made generated templates non-reproducible across machines and was the actual cause of the StandardConfig_OfflineApply_MatchesSnapshot and CalendarStandardConfig_MatchesSnapshot golden-file failures. Pass useUserOverride: false so the format string depends only on the configured culture, not on the building machine's personal preferences.
@albertospelta
albertospelta merged commit 3b851b5 into main Jul 14, 2026
1 check passed
@albertospelta
albertospelta deleted the alberto/fix-test branch July 14, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants