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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DatePicker sets date incorrectly

Thread ID:

Created:

Updated:

Platform:

Replies:

151356 Feb 7,2020 02:39 PM UTC Feb 20,2020 01:21 PM UTC Blazor 5
loading
Tags: DatePicker
Mr Andrey Voronov
Asked On February 7, 2020 02:39 PM UTC

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



Sureshkumar P [Syncfusion]
Replied On 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 


Mr Andrey Voronov
Replied On 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)
....

Sureshkumar P [Syncfusion]
Replied On 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 
 


Mr Andrey Voronov
Replied On 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



Sureshkumar P [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon