vit-timetable
VIT Timetable to Calendar (NPM package)
Usage/Examples
import { makeGCalTimetable, makeCalendar, parseRawTimetable } from "vit-timetable";
async function GCalEventHandler() {
const text = document.getElementById("text-box").value;
const registrationNumber = document.getElementById("r-number").value;
const arrayOfCourses = parseRawTimetable(text,registrationNumber);
await makeGCalTimetable(arrayOfCourses);
}
function ICSEventHandler() {
const text = document.getElementById("text-box").value;
const arrayOfCourses = parseRawTimetable(text);
const OUTPUT = makeCalendar(arrayOfCourses);
downloadFileWithData(OUTPUT);
}
Contents
-
parseRawTimetable ⇒
Array.<Course>
-
Parses raw input text to return Array of Course objects
-
makeCalendar ⇒
Object
-
Make ICS file for Timetable events from Array of courses per student
- execute
-
Function to parse the Array of courses and make the user's Google Calendar
Automatically handles complete flow from Sign in to Registering Calendar request.
Typedefs
-
Course :
Object
-
Course object containing all parsed information per course.
Array.<Course>
parseRawTimetable ⇒ Parses raw input text to return Array of Course objects
Kind: global constant
Returns: Array.<Course>
- Parsed Array of courses
Param | Type | Description |
---|---|---|
rawTimetableText | string |
Raw timetable text from user input. |
registrationNumber | string |
Registration number of student |
Object
makeCalendar ⇒ Make ICS file for Timetable events from Array of courses per student
Kind: global constant
Returns: Object
- Output
Param | Type | Default | Description |
---|---|---|---|
courses | Array.<Course> |
Array of Course objects for all enrolled courses | |
[senior] | Boolean |
true |
Value to note which academic calendar to follow. |
makeGCalTimetable
Automatically handles complete flow from Sign in to Registering Calendar request.
Kind: global constant
Param | Type | Default | Description |
---|---|---|---|
parsedParameters | Array.<Course> |
Parsed Array of courses | |
[senior] | Boolean |
true |
Value to note which academic calendar to follow. |
Object
Course : Course object containing all parsed information per course.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
slots | String |
Slots in capital separated by '+' symbol |
courseType | String |
Course Types such as ETH, ELA, LO... |
courseName | String |
Full Course name |
courseCode | String |
Full Course Code |
location | String |
Room number of course location |
teacherName | String |
Name of main faculty |