-
Notifications
You must be signed in to change notification settings - Fork 0
Timetable
github-actions[bot] edited this page Jul 25, 2026
·
1 revision
The Timetable module fetches, parses, and normalizes the student's calendar. It also allows you to retrieve a subscription URL for external calendar systems (Apple Calendar, Google Calendar, Outlook, etc.).
Let's fetch the student's timetable classes for the upcoming week:
import { getTimetable } from "linkdirecte";
const schedule = await getTimetable({
startDate: new Date(), // Start today
endDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Next 7 days
});
console.log(`Loaded ${schedule.timetable.length} timetable events.`);
schedule.timetable.forEach(classSession => {
const status = classSession.isAnnule ? "❌ CANCELLED" : "✅ ACTIVE";
console.log(`\n[${status}] Subject: ${classSession.matiere}`);
console.log(` Time: ${classSession.start_date.toLocaleTimeString()} - ${classSession.end_date.toLocaleTimeString()}`);
console.log(` Room: ${classSession.salle || "No room assigned"}`);
console.log(` Teacher: ${classSession.prof || "Unspecified teacher"}`);
});Let's fetch an iCal subscription link:
import { getTimetableIcalUrl } from "linkdirecte";
const calendarUrl = await getTimetableIcalUrl();
console.log("Add this link to your Google or Apple Calendar subscription feed:");
console.log(calendarUrl);Retrieves a chronologically ordered array of scheduled class sessions.
function getTimetable(options?: {
startDate?: string | Date;
endDate?: string | Date;
}): Promise<TimetableResult>-
options(optional):-
startDate(string | Date): The beginning of the timetable window. Can be a standard JavaScriptDateobject or an ISO-style date string ("YYYY-MM-DD"). Defaults to today. -
endDate(string | Date): The end of the timetable window. Defaults to the same value asstartDate.
-
Retrieves the URL for the student's timetable in iCal format for integration with external calendar systems.
function getTimetableIcalUrl(): Promise<string>interface TimetableResult {
timetable: TimetableEntry[];
}The properties of TimetableEntry are returned as raw EcoleDirecte API keys (no translation is performed by the SDK):
| Property | Type | Description |
|---|---|---|
id |
number |
Unique ID of the schedule slot. |
codeMatiere |
string |
Short identifying code of the subject. |
matiere |
string |
Full display name of the subject (e.g. "Mathématiques"). (raw key) |
start_date |
Date |
Start date and time of the class. (raw key) |
end_date |
Date |
End date and time of the class. (raw key) |
prof |
string (optional)
|
Name of the teacher hosting this class session. (raw key) |
salle |
string (optional)
|
Classroom label or number. (raw key) |
groupe |
string (optional)
|
Specific classroom group assigned. (raw key) |
isAnnule |
boolean (optional)
|
true if the session has been cancelled. (raw key) |
color |
string (optional)
|
Calendar color hex code (provided by the school's workspace). |
© 2026 typeof (Scolup) | Licensed under AGPL 3.0