Unintended localization for DateTime strings #56053
Labels
area-blazor
Includes: Blazor, Razor Components
Needs: Attention 👋
This issue needs the attention of a contributor, typically because the OP has provided an update.
Is there an existing issue for this?
Describe the bug
We're seeing unintentional localization occuring on the marketing site. On the Blazor project, we do not have localization enabled.
The code that is causing this issue is here:
show.LocalScheduledStartTime?.ToString("hh:mmtt")
It appears that converting a DateTime to a string is automatically also taking browser locale into consideration even though we do not have it enabled in our
Program.cs
fileExpected Behavior
The DateTime toString method should not automatically convert DateTimes to the browser locale when localization is not enabled on the project.
Steps To Reproduce
Repo steps:
English (United States)
in the footer dropdownExceptions (if any)
No response
.NET Version
8.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: