IgniteUI / igniteui-blazor

Ignite UI for Blazor component library packs 35+ native Blazor UI Controls with 60+ high-performance Charts designed for any Blazor WASM or Server-side app scenario.
https://www.infragistics.com/products/ignite-ui-blazor
3 stars 3 forks source link

Date picker throws errors when date is deleted #106

Open wnvko opened 5 months ago

wnvko commented 5 months ago

Description

I have IgbDatePicker two-way bound to a date variable. When value of the picker is deleted it throws and error.

Steps to reproduce

Add date picker like this:

<IgbDatePicker @bind-Value="_date"></IgbDatePicker>
<IgbDatePicker Value="_date" ValueChanged="@(e => _date = e)"></IgbDatePicker>

Run the application, set some value to the picker and delete it.

Result

Error are logged in the console.

Expected result

Errors should not be logged in the console.

MayaKirova commented 4 months ago

@wnvko This is probably related to this: https://github.com/IgniteUI/igniteui-react/issues/69#issuecomment-2114697664 Since the value when deleted becomes Mon Jan 01 0001, which when serialized to ISO format is '0000-12-31T22:26:44.000Z'. That however is not a valid date, so it throws an error in the Blazor's server side deserialization: System.FormatException: The DateTime represented by the string '0000-12-31T22:26:44.000Z' is not supported in calendar 'System.Globalization.GregorianCalendar'.

I'm guessing that first a change needs to be introduced in the IgcDatePicker so it either returns a valid date or null/undefined so that serialization/deserialization can be possible.

dkamburov commented 3 months ago

Should we close this one and test it against the new datepicker?