# RadzenDatePicker time control enables the user to select an invalid date

**URL:** <https://forum.radzen.com/t/radzendatepicker-time-control-enables-the-user-to-select-an-invalid-date/5695>\
**Category:** Radzen.Blazor Components\
**Created:** [November 19, 2020, 10:52am UTC](https://forum.radzen.com/t/radzendatepicker-time-control-enables-the-user-to-select-an-invalid-date/5695 "2020-11-19T10:52:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ade](https://forum.radzen.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@ade](https://forum.radzen.com/u/ade)\
**Post date:** [November 19, 2020, 10:52am UTC](https://forum.radzen.com/t/radzendatepicker-time-control-enables-the-user-to-select-an-invalid-date/5695/1 "2020-11-19T10:52:50Z")

</div>

Hello,  
I defined a RadzenDatePicker control in this way

`<RadzenDatePicker style="display: block" ShowTime="true" HourFormat="24" HoursStep="1" MinutesStep="5" DateRender="@DateRender" Name="TargetPublishingDate" @bind-Value="TargetPublishingDate" />`

and this is the DateRender method

`private static void DateRender(DateRenderEventArgs args) { var currentDate = DateTime.Now; args.Disabled = args.Date.Date < currentDate.Date; }`

As you can see, the user shall not be able to select dates \< today.  
What I found out is that it is possible to select an invalid date by decreasing the time in the time control. For example, I select today's date (November 19)

 ![image](https://forum.radzen.com/uploads/default/original/2X/4/4c40cc268fba04be4552dcd77138bc3cf81b8868.png)

As you can see, November 18 is disabled  
Then if I decrease the time, the date changes to the 18th

 ![image](https://forum.radzen.com/uploads/default/original/2X/9/903820cb55d18325083c066d03441d199e0e5a64.png)

To me this looks like a bug, the date should stick to the selected one and not change when decreasing/increasing the time.

What is your take on that?

Thanks

---

<div class="post-metadata">

**Author:** ![ade](https://forum.radzen.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@ade](https://forum.radzen.com/u/ade)\
**Post date:** [November 23, 2020, 8:35am UTC](https://forum.radzen.com/t/radzendatepicker-time-control-enables-the-user-to-select-an-invalid-date/5695/2 "2020-11-23T08:35:57Z")

</div>

Hello,  
any feedback about this?

Thanks

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [November 23, 2020, 8:49pm UTC](https://forum.radzen.com/t/radzendatepicker-time-control-enables-the-user-to-select-an-invalid-date/5695/3 "2020-11-23T20:49:12Z")

</div>

Hi @ade,

The Radzen team [does not guarantee replies](http://forum.radzen.com/faq#community).

I have logged this issue for future improvement. You can use a validator to ensure the date is in the right range.
