calendar datepicker on mobile now easily toggled #1084

This commit is contained in:
zuzanna-maria 2024-01-08 12:27:40 +01:00
parent 11cd21a2e9
commit 8c32493a01
1 changed files with 14 additions and 16 deletions

View File

@ -1307,23 +1307,21 @@ ICS ==> create a new event with the same UID and a RECURRENCE-ID field (with a v
updateDateRange();
updateRecurring();
});
var f = Flatpickr(goDate, {
enableTime: false,
defaultDate: APP.calendar.getDate()._date,
clickOpens: false,
//dateFormat: dateFormat,
onChange: function (date) {
date[0].setHours(12);
f.destroy();
APP.moveToDate(+date[0]);
updateDateRange();
updateRecurring();
},
});
$(goDate).click(function () {
var f = Flatpickr(goDate, {
enableTime: false,
defaultDate: APP.calendar.getDate()._date,
//dateFormat: dateFormat,
onChange: function (date) {
date[0].setHours(12);
f.destroy();
APP.moveToDate(+date[0]);
updateDateRange();
updateRecurring();
},
onClose: function () {
setTimeout(f.destroy);
}
});
f.open();
f.isOpen ? f.close() : f.open()
});
APP.toolbar.$bottomL.append(h('div.cp-calendar-browse', [
goLeft, goToday, goRight, goDate