Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Blazor InputData resets after I start typing

I have the following code in a Blazor Server App form

<InputDate @bind-Value="_myclass.DateCreated" class ="form_control" min ="1753-01-01" max="9999-12-31 id="CreationDate" />

public class MyClass 
{
    public Datetime? DateCreated{get;set;}
}

The issue is when I try to edit the date, if it is set to

07/31/2022 and I click in the date component and try change the month, if I type 01 it changes the value to
01/dd/yyyy

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

. It has reset the whole date. Is there any way to avoid this?

>Solution :

remove the "?" from public DateTime? DateCreated{get;set;}

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading