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")
|
const timeslotData = await fetch("timeslots.json")
|
||||||
.then((res) => res.json());
|
.then((res) => res.json());
|
||||||
|
|
||||||
console.log(timeslotData);
|
|
||||||
|
|
||||||
const timeslots = timeslotData
|
const timeslots = timeslotData
|
||||||
.map(({ date, times }) => ({
|
.map(({ date, times }) => ({
|
||||||
dateString: date,
|
dateString: date,
|
||||||
date: utcDateFromString(date),
|
date: utcDateFromString(date),
|
||||||
times,
|
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>
|
let tableHtml = `<tr>
|
||||||
${
|
${
|
||||||
@ -91,10 +88,8 @@ async function makeScheduleTable() {
|
|||||||
scheduleForm.onsubmit = async (ev) => {
|
scheduleForm.onsubmit = async (ev) => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
const formdata = new FormData(ev.target);
|
const formdata = new FormData(ev.target);
|
||||||
const data = [...formdata].reduce(
|
const data = [...formdata]
|
||||||
(acc, [key, val]) => ({ ...acc, [key]: val }),
|
.reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {});
|
||||||
{},
|
|
||||||
);
|
|
||||||
if (!data.username) {
|
if (!data.username) {
|
||||||
alert("please specify username");
|
alert("please specify username");
|
||||||
return;
|
return;
|
||||||
@ -103,7 +98,6 @@ scheduleForm.onsubmit = async (ev) => {
|
|||||||
alert("please check information agreement");
|
alert("please check information agreement");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
const response = await fetch("/api/log", {
|
const response = await fetch("/api/log", {
|
||||||
method: "post",
|
method: "post",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user