This is a migrated thread and some comments may be shown as answers.

How to set multiple date in the calendar with mvvm?

4 Answers 185 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Federico
Top achievements
Rank 1
Federico asked on 15 Nov 2017, 04:48 PM

How to set multiple date in the calendar with mvvm.

I have my calendar :

<div id="calendar1" data-role="calendar"
          data-bind="value: Cvalue,
          dates: Csource,
          events:{change: ConChange}">
</div>

 

JS, view model:

Cvalue:null,
Csource:[],
Conchange:function(){
}
                

 

Csource contains:

[
 {"nome":"1"},{"data":"21/112017"},
 {"nome":"2"},{"data":"22/112017"},
 {"nome":"3"},{"data":"26/112017"},
 {"nome":"4"},{"data":"28/112017"},
 {"nome":"5"},{"data":"29/112017"}
 ]

 

 

Cain i see this dates with different color in the calendar?

and at onChange of day, i'd like to print the name of date;

 

 

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Federico
Top achievements
Rank 1
answered on 15 Nov 2017, 04:52 PM
something like this attached image
0
Stefan
Telerik team
answered on 17 Nov 2017, 01:08 PM
Hello, Federico,

The multiple dates can beset using our selectDates property:

https://docs.telerik.com/kendo-ui/api/javascript/ui/calendar#configuration-selectDates

http://dojo.telerik.com/ipAnE/5

Currently setting them directly from the model is not possible, but we have an open issue for that:

https://github.com/telerik/kendo-ui-core/issues/3775

In scenarios, where days have to be in different colors a custom template has to be used to programmatically set all of the dates and their color:

https://docs.telerik.com/kendo-ui/api/javascript/ui/calendar#configuration-month.content

If the selectDates configuration is used, then the selectDates method can be used in the change event to retrieve the currently selected dates:

https://docs.telerik.com/kendo-ui/api/javascript/ui/calendar#methods-selectDates

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
ID
Top achievements
Rank 1
answered on 01 Mar 2021, 03:01 PM

how can I let my user select multiple dates without using the ctrl-button.

when using a smartphone, there is no ctrl-button 

0
Nikolay
Telerik team
answered on 03 Mar 2021, 09:47 AM

Hello,

Multiple selections without using the ctrl key can be performed via selecting dates with the mouse. Please refer to the below screencast demonstrating this:

Let me know if you have any questions.

Regards,
Nikolay
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/.

Tags
Calendar
Asked by
Federico
Top achievements
Rank 1
Answers by
Federico
Top achievements
Rank 1
Stefan
Telerik team
ID
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or