chore: refactor JSON timetable import
This commit is contained in:
@@ -164,7 +164,7 @@ async function updateAcademicData() {
|
||||
|
||||
const firstMonday = getFirstMondayAfter(semesterStartDateStr);
|
||||
|
||||
const academicData = {
|
||||
const semesterData = {
|
||||
timetableIds,
|
||||
semesterStartDateStr,
|
||||
firstMondayDate: firstMonday.toISOString(),
|
||||
@@ -172,11 +172,11 @@ async function updateAcademicData() {
|
||||
lastUpdated: new Date().toISOString(),
|
||||
academicYear: getCurrentAcademicYear()
|
||||
};
|
||||
|
||||
// Save to public/timetable-ids-dates.json
|
||||
fs.writeFileSync('public/timetable-ids-dates.json', JSON.stringify(academicData, null, 2));
|
||||
|
||||
console.log('✅ Academic data updated successfully');
|
||||
|
||||
// Save to src/semester-data.json
|
||||
fs.writeFileSync('src/semester-data.json', JSON.stringify(semesterData, null, 2));
|
||||
|
||||
console.log('✅ Semester data updated successfully');
|
||||
}
|
||||
|
||||
// Run the script
|
||||
|
||||
Reference in New Issue
Block a user