Closed szalapski closed 3 years ago
I suspect this might be related to this: https://stackoverflow.com/questions/69542125/in-blazor-webassembly-in-a-component-how-can-i-make-datetime-tostring-use-the-d/69545067#69545067
All WebAssembly component outputs show me that DateTimeFormatInfo.CurrentInfo.ShortDatePattern == "M/d/yyyy"
even though CultureInfo.CurrentCulture.Name == "en-GB"
. Why might that be? What sets ShortDatePattern from the culture and can I "re-initialize" it?
Hi Patrick,
It looks like they have the wrong format in the WebAssembly runtime for the en-GB culture, but I checked it on version 6.0.0rc2, the correct format dd/MM/yyyy
is set there, you can try to update. This is not a problem anyway, the date format can be enforced using the DateFormat
property.
Thanks; that's surprising. I can't go live on version 6 till it is released. It isn't fixed in any version 5 package?
Where is DateFormat documented? I don't see it in the Readme. I tried to supply it with "dd/MM/yyyy" and it gave me this:
Very strange, I have never seen such a thing. What dotnet version and what kind of browser do you have? It turned out that the DateFormat
parameter is not in the documentation, I will add it, thanks for paying attention.
You can also take full control of the picker rendering with the PickerTemplate
but this is of course not very convenient.
Later I will check how the picker behaves in the latest dotnet 5 release.
Checked dotnet 5.0.10 - the format for en-GB is wrong there, in 6.0.0 it is fixed. But DateFormat
works for me on version 5.0.10, I checked it like this:
<DateRangePicker Culture="@(CultureInfo.GetCultureInfo("en-GB"))" DateFormat="dd/MM/yyyy" />
When I'm in en-GB culture, I'd expect to see
dd/MM/yyyy
date format, but instead I seeM/d/yyyy
. What could be wrong here?results in output: