Использую JQuery plugin DateRangePicker calendar. У меня на странице есть 2 календаря:
1. Скрытый календарь - работает без проблем.
2. Видимый календарь - при выборе даты на календаре вылазит ошибка:
Cannot read properties of null (reading 'format') at DateRangePicker.updateElement
Код функции updateElement:
updateElement: function() {
if (this.element.is('input') && this.autoUpdateInput) {
var newValue = this.startDate.format(this.locale.format);
if (!this.singleDatePicker) {
newValue += this.locale.separator + this.endDate.format(this.locale.format);
}
if (newValue !== this.element.val()) {
this.element.val(newValue).trigger('change');
}
}
},
Ссылка на страницу:
https://m-coder.ru/calendar/
Подскажите, как исправить эту ошибку?