@using Syncfusion.Blazor
@using Syncfusion.Blazor.Calendars
@page "/DatePickerBug"
<h3>DatePickerBug</h3>
<label>Select february</label>
<SfDatePicker TValue=DateTime? @bind-Value="@date"
Format="MM/yyyy"
Start="@CalendarView.Year" required
Depth="@CalendarView.Year" maxlength="7"
ShowClearButton="true"
Enabled="true"
Readonly="false">
</SfDatePicker>
@code {
DateTime? date;
}
We got the following error by running the above code, it happens just when you select February in your first interaction or after using the clear button and selecting February
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Year, Month, and Day parameters describe an un-representable DateTime.
System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
at System.DateTime..ctor(Int32 year, Int32 month, Int32 day)
at Syncfusion.Blazor.Calendars.Internal.CalendarBaseRender`1.<SetDateYear>d__54[[System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Syncfusion.Blazor.Calendars.Internal.CalendarBaseRender`1.<SelectDate>d__56[[System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Syncfusion.Blazor.Calendars.Internal.CalendarBaseRender`1.<ContentClick>d__52[[System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Syncfusion.Blazor.Calendars.Internal.CalendarBaseRender`1.<CellClick>d__51[[System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Syncfusion.Blazor.Calendars.Internal.CalendarBaseRender`1.<ClickHandler>d__50[[System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
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, ComponentState owningComponentState)
Hi Rodrigo,
We have validated the reported query on our end. Unfortunately, we couldn’t reproduce the reported issue as per your scenario. We have shared a sample and video illustration for reference. Also, we request you to provide additional details about the issue as mentioned below. This will help us validate the issue further and provide you with a better solution.
1. Are you facing the issue in any particular scenario?
2. Is the DatePicker component rendered within any other component(Ex: Dialog) or alone?
4. Issue reproducing runnable sample (or modify the shared sample).
5. Issue replication steps.
6. Video illustration of the issue.
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/BLAZdatepicker-494103202
Regards,
Udhaya Kumar D
Hi,
In the example attached, if you click on the calendar icon then on the year and select any year other than current year it throws the exception.
Can you please let me know if you can reproduce it?
Kind Regards,
Anand Kulkarni
Hi Rodrigo Bernardi,
We've thoroughly reviewed the sample you provided, and we attempted to replicate the issue by following the steps you mentioned. However, we were unable to reproduce the exception at our end. Please refer to the attached video for your reference.
To assist you more effectively, could you please modify the attached sample according to your scenario or provide a complete runnable sample? Additionally, if you could provide detailed replication steps along with a video reference, it would greatly help us in understanding and addressing the issue.
We're committed to resolving this issue for you as soon as possible. Please feel free to reach out if you need any further assistance or have any additional questions.