Date Format with DatePicker

I have the following code:

When I type 4/1/2022 (meaning 4 Jan 2022), it shows 01/04/2022 (which is 1 Apr 2022) but it is okay if I type 04/01/2022 it stays at 04/01/2022.

Users do have a tendency to just enter 4/1/2022 ie without the zeros or day & month and will get the wrong date. Is there someway around this?

If I set the format to d/M/yyyy and now 4/1/2022 & 04/01/2022 were both fine but 4/1/22 was an issue. If I set the format d/M/yy then 4/1/22 was fine bith 4/1/2022 wasn't.

I'm keen to display 04/01/2022 and be able to enter 4/1/2022, 4/1/22 etc and have it display 04/01/2022 being 4 Jan 2022 and not have it automatically changed to 01/04/2022 being 1 Apr 2022

Is there a workaround for the above issue

Hi @kirank,

When parsing date, RadzenDatePicker will not specify any IFormatProvider and in this case current culture of your application will be used:

Not sure if we can do anything else.

Thank you for your reply.

The current .NET Framework 4.8 ASP.Net Webforms app that I'm converting has no such issue in the datepicker being used.

Is this an issue with .NET Core?

What component is used to enter dates in your old app? Check also if the old application is using specific Culture.

Don't have much info about the existing .NET Framework App.

Is there some way for this to work for me setting the culture?

I have used the DatePicker all over the place without realising this issue. I don't think users will accept an app with such an issue where they think they are entering a date like 4 Jan 2022 and end up with 1 Apr 2022 and it could easily be missed.

Do you have any suggestions

In my opinion you should set en-US culture for your application. Check our Startup for reference:

In this case when your users type 4/1/2022 you will always get 4 Jan 2022.

You can add cultures to your Radzen application by following these steps.

Thank you.

I set the Culture in Program.cs and this seems to have solved the issue