Unplanned
Last Updated: 29 Jul 2021 08:11 by ADMIN
Greg
Created on: 28 Jul 2021 13:43
Category: DatePicker
Type: Feature Request
0
RadDatePicker shared calendar mindate

I have started using a shared calendar on RadDatePicker.  I also added a JavaScript example found I believe in the Telerik forum to set the min date of one RadDatePicker to the chosen date on the other RadDatePicker for a date range.  This isn't working correctly with a shared calendar because setting the min date on one RadDatePicker sets it on the calendar for both RadDatePickers. My solution was an OnPopupOpening function on the RadDatePicker to reapply the min/max dates to the calendar.  Here is the code:


    function onPopupOpening(sender, args) {
        var box = sender.get_dateInput();
        var cal = sender.get_calendar();
        var min = box.get_minDate();
        var max = box.get_maxDate();
        var mindate = [min.getFullYear(), min.getMonth() + 1, min.getDate()];
        var maxdate = [max.getFullYear(), max.getMonth() + 1, max.getDate()];
        cal.set_rangeMinDate(mindate);
        cal.set_rangeMaxDate(maxdate);
    }

My suggestion is to either have this done automatically by RadDatePicker or include something similar in the documentation for others who may have the same issue.

Regards,

Greg

1 comment
ADMIN
Vessy
Posted on: 29 Jul 2021 08:11

Hi,

Thanks a lot for the shared feedback and solution, Greg. We will monitor the overall interest on this item will update its status depending on the item popularity.

Kind regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.