fix date handling in schedule db lookups to be deterministic by setting time portion to 00:00:00
This commit is contained in:
parent
8014d4c3fe
commit
ac0070f624
@ -784,11 +784,12 @@
|
|||||||
|
|
||||||
const init_schedules = (day) => {
|
const init_schedules = (day) => {
|
||||||
const day_of_schedule = day ? new Date(Date.parse(day)) : new Date();
|
const day_of_schedule = day ? new Date(Date.parse(day)) : new Date();
|
||||||
|
day_of_schedule.setHours(0).setMinutes(0).setSeconds(0);
|
||||||
|
|
||||||
// set up header
|
// set up header
|
||||||
const current_day_indicator = document.querySelector("#current_day_indicator");
|
const current_day_indicator = document.querySelector("#current_day_indicator");
|
||||||
current_day_indicator.innerHTML = `<center>Schedule for <strong>${day_of_schedule.toDateString()}</strong></center>`;
|
current_day_indicator.innerHTML = `<center>Schedule for <strong>${day_of_schedule.toDateString()}</strong></center>`;
|
||||||
current_day_indicator.setAttribute("data-day", day_of_schedule.setHours(0).setMinutes(0).setSeconds(0).toISOString());
|
current_day_indicator.setAttribute("data-day", day_of_schedule.toISOString());
|
||||||
// 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user