fix schedule time
This commit is contained in:
parent
aef8920ead
commit
56df2ae947
@ -39,7 +39,11 @@ async function makeScheduleTable() {
|
||||
const timeslots = timeslotData
|
||||
.map(({ date, times }) => ({
|
||||
dateString: date,
|
||||
date: new Date(date),
|
||||
// yea soo this hack makes the Date UTC
|
||||
date: new Date(
|
||||
new Date(date).getTime() -
|
||||
new Date().getTimezoneOffset() * 60 * 1000,
|
||||
),
|
||||
times,
|
||||
}))
|
||||
.toSorted((a, b) => a.date.getTime() - b.date.getTime());
|
||||
@ -47,7 +51,9 @@ async function makeScheduleTable() {
|
||||
let tableHtml = `<tr>
|
||||
${
|
||||
timeslots.map((ts) =>
|
||||
`<th>${weekDayNames[ts.date.getUTCDay()]} ${ts.date.getUTCDay()}. ${
|
||||
`<th>${
|
||||
weekDayNames[ts.date.getUTCDay()]
|
||||
} ${ts.date.getUTCDate()}. ${
|
||||
monthNames[ts.date.getUTCMonth()]
|
||||
}</th>`
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user