We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DatePicker sets date incorrectly

I am using the latest version 17.4.47

<EjsDatePicker TValue="DateTime?" Format="dd/MM/yyyy" @bind-Value="@Date"></EjsDatePicker>

@code {
private DateTime? date = null;

public DateTime? Date
{
get => date;
set
{
date = value;
}
}
}

Set breakpoint on date=value and select date as 8th of Feb (NOT TODAY)

Breakpoint will be hit twice, once with 2019-02-08, and the second time with incorrect 2019-08-02 value

Please fix this ASAP



5 Replies

SP Sureshkumar P Syncfusion Team February 10, 2020 11:33 AM UTC

Hi Andrey, 
 
We confirmed the reported issue " While given format as "dd/MM/yyyy", value get changed as "MM/dd/yyyy " format" as a bug in our end and the fix will be available in our next week patch release which is expected to be rolled out at February 19th, 2020. You can track the status of the bug in the below feedback link from below.   
   
 
Regards,  
Sureshkumar P 



MA Mr Andrey Voronov February 18, 2020 12:44 PM UTC

Still not been fixed in 17.4.50 release

Now I  am getting

System.FormatException: String '18/02/2020 00:00:00' was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
....


SP Sureshkumar P Syncfusion Team February 19, 2020 09:31 AM UTC

Hi Andrey, 
 
Thanks for your update. 
 
Based on your shared error details. We suspect that your assigned value is not proper datetime object (eg: passed value is in string format instead of datetime format). We suggest you check the assigned value is in correct datetime format or not to resolve the facing issue. 
 
Kindly refer the below code example. 
 
<EjsDatePicker TValue="DateTime?" Format="dd/MM/yyyy" @bind-Value="@Date"></EjsDatePicker> 
 
@code { 
       private DateTime? date = new DateTime(2019,10,10); 
 
       public DateTime? Date 
       { 
              get => date; 
              set 
              { 
                      date = value; 
              } 
       } 
} 
 
 
Regards, 
Sureshkumar P 
 



MA Mr Andrey Voronov February 20, 2020 08:03 AM UTC

Replace new DateTime(2019,10,10with new DateTime(2020, 02, 19)

Click on calendar button to reproduce the issue




SP Sureshkumar P Syncfusion Team February 20, 2020 01:21 PM UTC

Hi Andrey, 
  
Sorry for the inconvenience caused. 
 
We were able to replicate your reported problem. We have confirmed this as a bug at our end. We will fix and include the solution on our March first week patch release, which is expected to be rolled out on March 3rd, 2020. Please be patient until then. 
 
You can track the status of this problem by using the below feedback portal. 
 
 
Regards, 
Sureshkumar P 


Loader.
Live Chat Icon For mobile
Up arrow icon