I add a custom tag to the days of the calendar but it is added in all months to the selected days.

Need help to solve the problem. There is a calendar in which you can add your custom tag to the number. But the problem is that this tag is added in all the months of the days I have chosen (in my case these are the numbers 1, 10, 12, 25).

You need to make it so that in different months you can add this tag to different days.

The calendar itself (picker date) ( http://t1m0n.name/air-datepicker/docs/index-ru.html#install )

My code from the documentation

$('#calendar').datepicker({ inline: true, minDate: new Date() }); var eventDates = [1, 10, 12, 25], $picker = $('#calendar'), sentences = []; $picker.datepicker({ onRenderCell: function (date, cellType) { var currentDate = date.getDate(); // Добавляем вспомогательный элемент, если число содержится в `eventDates` if (cellType == 'day' && eventDates.indexOf(currentDate) != -1) { return { html: currentDate + '<span class="dp-note"></span>' } } } }); 

    1 answer 1

    As I understand it, you need to add these tags only in a specific month, and you have not added a month check.

     $('#datepicker').datepicker({ // Добавить свой контент во все ячейки с датой 31 декабря. onRenderCell: function (date, cellType) { if (cellType == 'day' && date.getDate() == 31 && date.getMonth() == 11) { return { classes: '-ny-', html: 'Новый год!' } } } })