When editing a form with data, when I click the control to "EDIT" my saved date range selection it's opening on Todays date instead of my date range selection.
Any idea how to resolve this?
5 Answers, 1 is accepted
0
Hi Nicolas,
Currently the dateView will be opened with the today's date view, but after the initialization of the widget you can set the dataView._current value to a particular date:
You can also log this as a feature request in our public portal:
Regards,
Konstantin Dikov
Progress Telerik
Currently the dateView will be opened with the today's date view, but after the initialization of the widget you can set the dataView._current value to a particular date:
$("#pickerid").data("kendoDateRangePicker").dateView._current = new Date(2015, 2,2)
You can also log this as a feature request in our public portal:
Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

Nicolas
Top achievements
Rank 1
Iron
answered on 31 May 2019, 01:20 PM
I will request this as a feature.
The code you just gave me is half way working. It seems that it shift evrything by a month after as you see in my capture. Something must be wrong I guess. My event start is in august and it open on Septembre.
$(document).ready(function () {
$("#daterangepicker").data("kendoDateRangePicker").dateView._current = new Date(@Model.StartDate.Year, @Model.StartDate.Month,@Model.StartDate.Day);
});
0
Hi Nicolas,
The reason for the offset by a month is that the JavaScript Date is using zero-based indexes for the months. Thus, the index of August is 7.
In order to resolve this I suggest subtracting one from StartDate.Month when setting the current view for the DateRangePicker:
With that said, I also created a feature request in our portal on your behalf. Based on the votes it gathers we will be able to prioritize it with the other requests so it can be included in the planning.
Regards,
Viktor Tachev
Progress Telerik
The reason for the offset by a month is that the JavaScript Date is using zero-based indexes for the months. Thus, the index of August is 7.
In order to resolve this I suggest subtracting one from StartDate.Month when setting the current view for the DateRangePicker:
$(document).ready(
function
() {
$(
"#daterangepicker"
).data(
"kendoDateRangePicker"
).dateView._current =
new
Date(@Model.StartDate.Year, @Model.StartDate.Month-1, @Model.StartDate.Day);
});
With that said, I also created a feature request in our portal on your behalf. Based on the votes it gathers we will be able to prioritize it with the other requests so it can be included in the planning.
Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

Nicolas
Top achievements
Rank 1
Iron
answered on 05 Jun 2019, 01:31 PM
Hi, Thank you and figured that out already but still a bit counter intuitive while mixing MVC/Core and JS :-)
0
Hello Nicolas,
I understand your position.
The reason behind this is that the MVC and Core components are actually wrappers of the Kendo UI for jQuery widgets. Thus, when a customization of the default behavior is required it is necessary to use JavaScript in order to change the settings of the underlying widget.
Regards,
Viktor Tachev
Progress Telerik
I understand your position.
The reason behind this is that the MVC and Core components are actually wrappers of the Kendo UI for jQuery widgets. Thus, when a customization of the default behavior is required it is necessary to use JavaScript in order to change the settings of the underlying widget.
Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.