dont use newest js functions
This commit is contained in:
parent
4dac13bcc0
commit
aebe28a5f1
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user