Skip to content

Commit

Permalink
- Merge consecutive slots of same course
Browse files Browse the repository at this point in the history
  • Loading branch information
PardhavMaradani committed Sep 23, 2024
1 parent ab48f9f commit 4ca38fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ function exportExamScheduleICS() {
continue;
}
const date = cols[6].innerText;
if (date == '') {
continue;
}
const [startTime, endTime] = cols[9].innerText.split(' - ');
const summary = '(' + cols[3].innerText + ') ' + cols[2].innerText;
const description =
Expand Down Expand Up @@ -346,6 +349,14 @@ function parseTT() {
start: sT[tol][cc],
end: eT[tol][cc]
};
if (events[day].length > 0) {
const prevEvent = events[day][events[day].length - 1];
if (prevEvent.id == event.id && prevEvent.type == event.type && prevEvent.venue == event.venue) {
// Merge consecutive slots of same course
prevEvent.end = event.end;
continue;
}
}
events[day].push(event);
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "VIT Timetable Export",
"version": "1.5",
"version": "1.6",
"description": "Export VIT Timetable as iCalendar (.ics) File",
"permissions": ["contextMenus", "scripting", "activeTab"],
"background": {
Expand Down

0 comments on commit 4ca38fe

Please sign in to comment.