month Object
Templates for the cells rendered in the calendar "month" view.
month.content String
The template to be used for rendering the cells in "month" view, which are between the min/max range.
Example - specify cell template as a string literal
<style>
.exhibition{color:blue}
.party{color:red}
</style>
<input id="datepicker" />
<script>
$("#datepicker").kendoDatePicker({
month: {
content: (data) => `<span class="${data.value < 10 ? 'exhibition' : 'party'}">${data.value}</span>`
}
});
</script>
month.weekNumber String
The template to be used for rendering the cells in "week" column. By default, the widget renders the calculated week of the year. The properties available in the data object are:
- currentDate - returns the first date of the current week.
- weekNumber - calculated week number.
These properties can be used in the template to make additional calculations.
Example - specify week number template as a string
<style>
.italic{
font-style: italic;
}
</style>
<body>
<input id="datepicker1" />
<script>
$("#datepicker1").kendoDatePicker({
weekNumber: true,
month: {
weekNumber: ({ weekNumber }) => `<a class="italic">${weekNumber}</a>`
}
});
</script>
month.empty String
The template used for rendering cells in the "month" view, which are outside the min/max range.
Example - specify an empty cell template as a string
<input id="datepicker1" />
<script>
$("#datepicker1").kendoDatePicker({
month: {
empty: '-'
}
});
</script>
Example - add date value to the out-of-range cells
<input id="datepicker2" />
<script>
$("#datepicker2").kendoDatePicker({
month: {
empty: ({ value }) => `<span style="color:#ccc;padding:0 .45em 0 .1em;">${value}</span>`
}
});
</script>