Unplanned
Last Updated: 26 Apr 2022 10:35 by ADMIN
Neil N
Created on: 13 Apr 2021 18:40
Category: DatePicker
Type: Feature Request
11
Set focused (initial) date that is different than the Value

I would like the following behavior in the date picker. Perhaps it can be achieved with a parameter similar to the one in UI for ASP.NET AJAX - the FocusedDate property (something like RadDatePicker1.FocusedDate = DateTime.Today.AddDays(30);).

The current behaviour is:

* if date is set, show month of set date
*else show month of current date (today)

Desired behaviour:

* if date is set, show month of set date
* else if min date's month is greater than current date month then show month of min date
* else show month of current date

Here is a code snippet to illustrate the issue:

Open the picker - it will start in the month with today's date, but I want it to start at the min date - one month later

<TelerikDatePicker @bind-Value="@theDate" Min="@minDate" Max="@maxDate"></TelerikDatePicker>
@code {
    DateTime theDate = DateTime.Now;
    DateTime minDate = DateTime.Now.AddDays(60);
    DateTime maxDate = DateTime.Now.AddDays(230);
}

3 comments
ADMIN
Dimo
Posted on: 26 Apr 2022 10:35

Hello everyone,

Thank you for describing your use case scenarios and needs.

This feature request has gained some popularity recently and is now in top 3 for the DatePicker. This makes it a good candidate for implementation when we allocate development effort for the date/time input components.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Steven
Posted on: 21 Apr 2022 14:14

We are also working on a solution where we have date pickers whose max dates are before 2022 as well as date pickers whose min dates are after 2022.

I do agree with the previous comment that adding a parameter/attribute where the developer can set the initial date when the calendar appears as oppose to it being set to today would make the user experience much smoother.  With an initial date option set, the user won't have to navigate multiple months (or even years) to get to eligible dates.  Thanks.

Tech
Posted on: 19 Apr 2022 18:40

We concur that adding a InitialFocusedDate parameter would be extremely helpful.  

For almost all of our date pickers, the allowed date range does not encompass Today, and there is no legitimate initial date value that we can start with.  The current workaround is laborious and code-intensive, and we have to do it for EVERY date picker.

I would think adding an InitialFocusedDate parameter would be easy for Telerik to implement, and it would save us a lot of work and code.  And from the other postings on this site, we are not alone.

Thanks!