Parser for transforming the lecture dates from the kit website and checking whether dates are in this span

Hierarchy

  • default

Constructors

Properties

timeSpans: TimeSpan[]
dateRegex: string = '[0-9]{2}[.][0-9]{2}[.][0-9]{4} - [0-9]{2}[.][0-9]{2}[.][0-9]{4}'
dateURL: string = 'https://www.sle.kit.edu/imstudium/termine-fristen.php'

Methods

  • Fetches the html source code form the given url

    Returns

    the html source code

    Parameters

    • url: string

      Website to fetch from

    Returns Promise<string>

  • Checks whether the given Date is a timespan where lectures are given

    Returns

    True if it is inside a week, where lectures are held, false otherwise. True if no timeSpans found

    Parameters

    • date: DateTime

      Date to check against

    Returns boolean

  • Creates a new TimeSpan from the given date strings

    Returns

    The corresponding TimeSpan

    Parameters

    • start: string

      String of first date

    • end: string

      String of last date

    • Optional startHourSetter: number

      Days to add to start date

    Returns TimeSpan

  • Parses the given times from the query function and transforms them into TimeSpans

    Returns

    The matching TimeSpans

    Parameters

    • dateStrings: string[]

      queried dates

    Returns TimeSpan[]

  • Parses the html string and extracts all the relevant dates from it

    Returns

    the dates

    Parameters

    • html: string

      html string

    Returns string[]

  • Transforms a date from the kit website into a date object

    Returns

    The corresponding date

    Parameters

    • d: string

      string to transform (DD.MM.YYY)

    Returns DateTime

Generated using TypeDoc