EDT

EDT

new EDT(group, date)

Source:
Parameters:
Name Type Description
group Group

The group you want courses for

date Date

From when to start filtering groups

Methods

build() → {Promise}

This function returns a Promise resolving the EDT object you just instanciated with Courses loaded in it

Source:
Returns:
Type:
Promise

containing EDT object with courses loaded

Example
new EDT(anyGroup, anyDate).build().then(edt => {
 // Treat your EDT object
}).catch(err => {
 // Treat your error
})

getClosestCourse() → {Course}

Get the nearest next course

Source:
Returns:
Type:
Course
Example
new EDT(anyDate, anyDate).build().then(edt => {
 // Note : You're not getting the course the closest to anyDate, but the closest to now
 const next = edt.getClosestCourse()
}).catch(err => {
 // Treat your error
})

getCourses() → {Array.<Course>}

Get all the new courses (courses from today, to calendar end)

Source:
Returns:
Type:
Array.<Course>
Example
new EDT(anyGroup, anyDate).build().then(edt => {
 // You'll end up getting only courses starting at anyDate
 const allCourses = edt.getCourses()
}).catch(err => {
 // Treat your error
})

getCoursesFrom(dateopt) → {Array.<Course>}

Get courses of date you pass as parameter

Source:
Parameters:
Name Type Attributes Default Description
date Date <optional>
new Date()

Date when course will be picked-up

Returns:
Type:
Array.<Course>

filtered courses

Example
new EDT(anyDate, anyDate).build().then(edt => {
 const tomorrowCourses = edt.getCoursesFrom(dateOfTomorrow)
}).catch(err => {
 // Treat your error
})

getGroup() → {Group}

Get group of EDT Object

Source:
Returns:
Type:
Group

you passed to constructor