dont use newest js functions

This commit is contained in:
sfja 2025-07-02 00:28:28 +02:00
parent 4dac13bcc0
commit aebe28a5f1

View File

@ -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 = `<tr>
${
@ -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",