Datepicker starts at 01/01/0001

is there a way to automatically make the date to todays date? 



1 Reply 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team October 16, 2020 01:12 PM UTC

Hello Dom, 
 
 
 
Greetings from Syncfusion support. 
 
 
We would like to inform you that by default DatePicker will be rendered based on the provided TValue type. If you are rendered the DatePicker with TValue as DateTime, then it will be rendered the component with default value of the DateTime type(01/01/1900) in C# . So, we suggest you to provide the TValue as DateTime Nullable (DateTime?). Also you can set the today date to the component using mentioned below code example. 
 
 
 
    <SfDatePicker TValue="DateTime?" @bind-value="dateValue"></SfDatePicker> 
 
@code{ 
    public DateTime? dateValue { get; set; } = DateTime.Today; 
} 
 
 
 
 
Regards, 
Sevvandhi N 


Marked as answer
Loader.
Up arrow icon