Skip to content

Commit

Permalink
Update semester config.
Browse files Browse the repository at this point in the history
  • Loading branch information
pedestrianlove committed Jan 3, 2024
1 parent dc71172 commit aeaf61c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions course-data/1122-data.json

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions js/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import TIME from "../semesterConfig.json" with { type: "json" };
let SEMESTER = "2";
let YEAR = "112";
fetch(`../semesterConfig.json`)
.then(r => r.json())
.then(data => {
SEMESTER = data["SEMESTER"];
YEAR = data["YEAR"];
document.getElementById('semester-tag').innerHTML = `${YEAR} 學年度 第 ${SEMESTER} 學期`;
document.getElementById('semester-tag').href = `https://course.thu.edu.tw/view-dept/${YEAR}/${SEMESTER}`;
});


const TIME_MAPPING = {
'A': "7:10 ~ 8:00",
Expand Down Expand Up @@ -51,11 +61,4 @@ const WEEK_MAPPING = {
"日": 7,
}

const currentTime = new Date();
const SEMESTER = TIME.SEMESTER;
const YEAR = TIME.YEAR;
document.getElementById('semester-tag').innerHTML = `${YEAR} 學年度 第 ${SEMESTER} 學期`;
document.getElementById('semester-tag').href = `https://course.thu.edu.tw/view-dept/${YEAR}/${SEMESTER}`;


const APP_URL = `${location.protocol}//${location.host}${location.pathname}`;

0 comments on commit aeaf61c

Please sign in to comment.