Class TimeTable

The time table resource

Hierarchy

  • TimeTable

Implements

  • SubjectContainer

Constructors

Properties

entries: Entry[]
subjectShorts: Map<string, string> = ...
htmlHandler: ((html: CheerioAPI) => TimeTable)

Type declaration

    • (html: CheerioAPI): TimeTable
    • Parse the TimeTable from HTML in a custom way

      Returns

      a new TimeTable instance

      Example

      // use custom html-handler
      TimeTable.htmlHandler = (html) => {
      var div = html("my-div")
      var data = div.text()

      return new TimeTable(...)
      }

      Example

      // reset html-handler to default
      TimeTable.htmlHandler = undefined

      Parameters

      • html: CheerioAPI

        The html object from where the data is to be extracted

      Returns TimeTable

Methods

  • Find a certain entry by the class name

    Returns

    an Array of Entries that match the className

    Parameters

    • className: string

      The class name you want to search for

    Returns Entry[]

  • Find a certain entry by a room name

    Returns

    an Array of Entries that match the roomName

    Parameters

    • roomName: string

      The room you want to search for

    Returns Entry[]

  • Find a certain subject by its long subject name. For e.g Englisch for E.

    If you want to find a subject based on its subject short, then please use the TimeTable.findBySubjectShort function

    Returns

    an Array of Entries that match the subject

    Parameters

    • subject: string

      The full subject name

    Returns undefined | Entry[]

  • Find a certain subject by its subject short. For e.g the short for Englisch would be E.

    If you want to find a subject based on its long name, use the TimeTable.findBySubjectLong function

    Returns

    an Array of Entries that match the subject

    Parameters

    • subject: string

      The subject short you want to search for

    Returns Entry[]

  • Update the subject shorts for all entries in this timetable instance

    Example

    timetable.registerSubjectShorts(new Map([["D", "Deutsch"]]))
    

    Parameters

    • subjectShorts: Map<string, string>

      The subject shorts mapped to their long name

    Returns void

Generated using TypeDoc