fix schedule day buttons

This commit is contained in:
Sundog Jones 2024-09-09 10:28:55 -04:00
parent ff5fa5d683
commit 11a9ba7149

View File

@ -625,6 +625,7 @@
// first column of schedule, set up the grid // first column of schedule, set up the grid
const current_day_indicator = document.querySelector("#current_day_indicator"); const current_day_indicator = document.querySelector("#current_day_indicator");
current_day_indicator.innerHTML = `Schedule for <strong>${day_of_schedule.toDateString()}</strong>`; current_day_indicator.innerHTML = `Schedule for <strong>${day_of_schedule.toDateString()}</strong>`;
current_day_indicator.setAttribute("data-day", day_of_schedule);
// set up previous/next buttons // set up previous/next buttons
document.querySelector('#previous_day_button').addEventListener("click", previous_day_schedule); document.querySelector('#previous_day_button').addEventListener("click", previous_day_schedule);
document.querySelector('#next_day_button').addEventListener("click", next_day_schedule); document.querySelector('#next_day_button').addEventListener("click", next_day_schedule);
@ -644,12 +645,14 @@
const previous_day_schedule = (e) => { const previous_day_schedule = (e) => {
e.preventDefault(); e.preventDefault();
const day = new Date(e.target.getAttribute("data-day") - 86400);
init_schedules(day);
} }
const next_day_schedule = (e) => { const next_day_schedule = (e) => {
e.preventDefault(); e.preventDefault();
const day = new Date(e.target.getAttribute("data-day") + 86400);
init_schedules(day);
} }
const tag_editor_handlers = () => { const tag_editor_handlers = () => {