Skip to content

Commit

Permalink
🐛 fix sunday not show
Browse files Browse the repository at this point in the history
  • Loading branch information
nrmnqdds committed Oct 5, 2024
1 parent f33f143 commit 5b1adfb
Show file tree
Hide file tree
Showing 6 changed files with 617 additions and 953 deletions.
2 changes: 1 addition & 1 deletion components/schedule/TimetableEventBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function TimetableEventBlock({
5;

const left = `calc(${
(100 / numberOfDays) * (event.timestamps.day - config.startDay)
(100 / numberOfDays) * (event.timestamps.day - config.startDay - 1)
}% )`;

const width = `calc(${100 / numberOfDays}% - 5px)`;
Expand Down
2 changes: 1 addition & 1 deletion lib/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function ImaluumLogin(form: {
if (cookie.key === "MOD_AUTH_CAS") {
cookies().set({
name: "MOD_AUTH_CAS",
value: cookie.value,
value: cookie.value!,
expires: new Date(Date.now() + 600000), // 10 minutes
});
break;
Expand Down
28 changes: 14 additions & 14 deletions lib/server/schedule-scraper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ const getScheduleFromSession = async (
.replace(/ /gi, "")
.split("-")
.map((x) => {
if (x.includes("SUN")) return 0;
if (x === "M" || x.includes("MON")) return 1;
if (x === "T" || x.includes("TUE")) return 2;
if (x === "W" || x.includes("WED")) return 3;
if (x === "TH" || x.includes("THUR")) return 4;
if (x === "F" || x.includes("FRI")) return 5;
if (x.includes("SAT")) return 6;
if (x.includes("SUN")) return 1;
if (x === "M" || x.includes("MON")) return 2;
if (x === "T" || x.includes("TUE")) return 3;
if (x === "W" || x.includes("WED")) return 4;
if (x === "TH" || x.includes("THUR")) return 5;
if (x === "F" || x.includes("FRI")) return 6;
if (x.includes("SAT")) return 7;
});
if (!days) {
continue;
Expand Down Expand Up @@ -165,13 +165,13 @@ const getScheduleFromSession = async (
.replace(/ /gi, "")
.split("-")
.map((x) => {
if (x.includes("SUN")) return 0;
if (x === "M" || x.includes("MON")) return 1;
if (x === "T" || x.includes("TUE")) return 2;
if (x === "W" || x.includes("WED")) return 3;
if (x === "TH" || x.includes("THUR")) return 4;
if (x === "F" || x.includes("FRI")) return 5;
if (x.includes("SAT")) return 6;
if (x.includes("SUN")) return 1;
if (x === "M" || x.includes("MON")) return 2;
if (x === "T" || x.includes("TUE")) return 3;
if (x === "W" || x.includes("WED")) return 4;
if (x === "TH" || x.includes("THUR")) return 5;
if (x === "F" || x.includes("FRI")) return 6;
if (x.includes("SAT")) return 7;
});

if (!days) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"lucide-react": "^0.303.0",
"meshline": "^3.3.1",
"moment": "^2.29.4",
"next": "latest",
"next": "^14.2.14",
"next-themes": "^0.2.1",
"node-html-parser": "^6.1.10",
"postcss": "latest",
"react": "latest",
"react-dom": "latest",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.49.2",
"react-hot-toast": "^2.4.1",
"react-icons": "^4.10.1",
Expand Down
Loading

0 comments on commit 5b1adfb

Please sign in to comment.