From aebe28a5f110235d0ea08b056c5635024e70c5a2 Mon Sep 17 00:00:00 2001 From: sfja Date: Wed, 2 Jul 2025 00:28:28 +0200 Subject: [PATCH] dont use newest js functions --- public/index.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/public/index.js b/public/index.js index 7fed8a1..31a0fdf 100644 --- a/public/index.js +++ b/public/index.js @@ -46,17 +46,14 @@ async function makeScheduleTable() { const timeslotData = await fetch("timeslots.json") .then((res) => res.json()); - console.log(timeslotData); - const timeslots = timeslotData .map(({ date, times }) => ({ dateString: date, date: utcDateFromString(date), times, - })) - .toSorted((a, b) => a.date.getTime() - b.date.getTime()); + })); - console.log(timeslots); + timeslots.sort((a, b) => a.date.getTime() - b.date.getTime()); let tableHtml = ` ${ @@ -91,10 +88,8 @@ async function makeScheduleTable() { scheduleForm.onsubmit = async (ev) => { ev.preventDefault(); const formdata = new FormData(ev.target); - const data = [...formdata].reduce( - (acc, [key, val]) => ({ ...acc, [key]: val }), - {}, - ); + const data = [...formdata] + .reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {}); if (!data.username) { alert("please specify username"); return; @@ -103,7 +98,6 @@ scheduleForm.onsubmit = async (ev) => { alert("please check information agreement"); return; } - console.log(data); const response = await fetch("/api/log", { method: "post",