DateRange Picker - End date issue

1 Answer 150 Views
DateRangePicker
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Ilan asked on 01 Sep 2022, 10:30 AM

Why this happening after selecting the start date?

 

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 06 Sep 2022, 06:44 AM

Hi, Ilan,

When the Telerik Blazor DateRangePicker is used and a new date is attempted to be selected, the End date will be set to the default value of the DateTime data type that is 1st of January 0001 (0001/01/01, or any other format used by the specific culture of the application). 

Based on the provided information, I suspect that the Start and End dates for the component are non-nullable DateTime properties, is that correct? If so, you can make them nullable so that when a selection is initiated, a mask (YYYY/MM/DD) is shown instead of the default date. 

    public DateTime? StartValue { get; set; }
    public DateTime? EndValue { get; set; }

This behavior can be observed in our DateRangePicker Overview demo.

Let me know if additional clarification is needed.

Kind regards,
Tsvetomir
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
DateRangePicker
Asked by
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Answers by
Tsvetomir
Telerik team
Share this question
or