This is a migrated thread and some comments may be shown as answers.

Globalization Demos do not include Format parameter

5 Answers 119 Views
DateRangePicker
This is a migrated thread and some comments may be shown as answers.
Jeff Fritz
Top achievements
Rank 1
Jeff Fritz asked on 23 Feb 2021, 04:31 PM

The Format="d" parameter for the demo site is not in use and does not pick up different cultures appropriately from browser.

 

Also:  the en-GB format does not get applied to the date format when the browser language preference is set to English-United Kingdom

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 23 Feb 2021, 08:47 PM

Hi Fritz,

Our demos aren't designed to read the browser culture, there is a chooser for a few example ones in a dropdown, such as here where we have German, Spanish, Bulgarian and US English: https://demos.telerik.com/blazor-ui/daterangepicker/globalization

I'm attaching here a sample app that seems to work fine for me and renders things as expected when the culture is set on the app correctly, which is something the app needs to do, our components cannot presume to do that instead of the developer, and we simply use what the framework gives us. 

Am I missing something in the setup? Does it work as expected for you?

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Marin Bratanov
Telerik team
answered on 24 Feb 2021, 01:20 PM

Here is also a WASM version that seems to also work as expected (the range picker is in the Counter page) when the .NET default thread culture is set.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Marin Bratanov
Telerik team
answered on 24 Feb 2021, 01:39 PM

And here is a version where Blazor sets the culture as per the browser preferred language (you need <BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData> in the csproj for that to work properly).

This sample is the same one but without the culture chooser in the UI and without the explicit setting for the culture in Program.cs.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Accepted
Jeff Fritz
Top achievements
Rank 1
answered on 24 Feb 2021, 02:50 PM

That was the issue -- I was missing the BlazorWebAssemblyLoadAllGlobalizationData entry in csproj.

 

Once that was added...  Dates were formatted properly.

0
Marin Bratanov
Telerik team
answered on 24 Feb 2021, 02:52 PM

Happy to see you moving forward!

I've also marked your post as the answer to the thread for anyone else having a similar mishap.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DateRangePicker
Asked by
Jeff Fritz
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Jeff Fritz
Top achievements
Rank 1
Share this question
or