Modern Kendo Datetime Picker

0 Answers 29 Views
Date/Time Pickers DateInput
GOVERTHANAN
Top achievements
Rank 1
Iron
GOVERTHANAN asked on 20 Dec 2023, 02:53 PM
Hi there!
   i have been using a modern kendo datetimepicker in my project. where i got the requirement from the user which while selecting the date value   in datetimepicker component its automatically navigating to the time page.  Is there any way to restrict those behaviour and makes the component close while changing the date alone.


Kindly find the attached image for more clarity about the case.
Nikolay
Telerik team
commented on 25 Dec 2023, 05:15 AM

Hi GOVERTHANAN,

As far as I understand you need to close the calendar popup when a date is selected. Please correct me if I am wrong.

This can be achieved by calling the close() method of the component on the click of a td element of the Calendar. For example:

      $("#datetimepicker").kendoDateTimePicker({
        componentType: "modern",
        open: function(e) {
          $(".k-calendar-tbody .k-calendar-td").on("click", function(ev) {
            let value = $(ev.currentTarget).find(".k-link").attr("data-value")
            e.sender.value(new Date(value)); // set the value
            e.sender.close("date"); // close the calendar
          })
        }
      });

Dojo demo: https://dojo.telerik.com/ELesoBiF

Regards,

Nikolay

No answers yet. Maybe you can help?

Tags
Date/Time Pickers DateInput
Asked by
GOVERTHANAN
Top achievements
Rank 1
Iron
Share this question
or