Two way data binding DatePicekr not working

When I try to bind DateTime? to DatePicerk  I get errors in console

2020-02-21T15:17:05.031Z] Error: System.FormatException: String '21.02.2020 00:00:00' was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.Convert.ToDateTime(String value, IFormatProvider provider)
   at System.String.System.IConvertible.ToDateTime(IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at Syncfusion.EJ2.Blazor.BaseComponent.ChangeType(Object value, Type conversionType, Boolean isClientChange)
   at Syncfusion.EJ2.Blazor.Calendars.GenericConvertion`1.GenericValue(DateTime value)
   at Syncfusion.EJ2.Blazor.Calendars.Internal.CalendarBaseRender`1.selectDate(MouseEventArgs events, String Id, Boolean multiSelection, DateTime[] values)
   at Syncfusion.EJ2.Blazor.Calendars.Internal.CalendarBaseRender`1.contentClick(CellDetails args, Int32 view, String classList, TValue value)
   at Syncfusion.EJ2.Blazor.Calendars.Internal.CalendarBaseRender`1.cellClick(CellDetails args, TValue value)
   at Syncfusion.EJ2.Blazor.Calendars.Internal.CalendarBaseRender`1.clickHandler(CellDetails args)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

My regional settings for browser and user use dd.MM.yyyy as Date Format
This worked before version17.4.50


<EjsDatePicker TValue="DateTime?" @bind-Value="@datum" ></EjsDatePicker>
<span>@(datum.HasValue? datum.Value.ToString("dd.MM.yyyy") :"")</span>
@code {
    public DateTime? datum { get; set; }
}


3 Replies

BC Berly Christopher Syncfusion Team February 24, 2020 09:59 AM UTC

Hi Admir, 
  
Greetings from Syncfusion support. 
  
We were able to replicate your reported problem and confirmed this as a bug at our end. We will fix and include the solution on our weekly 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,  
Berly B.C 



AH Admir Hodžic February 25, 2020 01:57 PM UTC

Looks like it has been solved in version 51 from 25. feb.2020


BC Berly Christopher Syncfusion Team February 26, 2020 10:53 AM UTC

Hi Admir,  
  
Thanks for providing information. 
  
While fix the culture related issue, format issue in DatePicker has been resolved at our end. So, we suggest you to use the latest version 17.4.51 to get rid of the reported issue. We will add the release notes details in our next patch release as promised.  
  
Regards, 
Berly B.C 


Loader.
Up arrow icon