Skip to content
This repository has been archived by the owner. It is now read-only.
A parser for St. Olaf SIS timestrings
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
src
.babelrc
.flowconfig
.gitignore
.npmrc
.travis.yml
CHANGELOG.md
README.md
index.js
package.json
yarn.lock

README.md

stolaf-sis-timestring-parser

DEPRECATED. This module has been supplanted by https://github.com/StoDevX/course-data-tools/blob/23265d6bc2db8ad2bf04cdcf1dd14ee955abde7a/lib/parse_timestring.py, as there is no longer a need to parse the timestrings in JS.

Build Status

A parser to take the wierd timestrings from St. Olaf's SIS and turn them into a semi-usable format.

Example:

// input
course = {times: ['MT 0100-0400PM', 'MF 0905-1000']}

convertTimeStringsToOfferings(course, {groupBy: 'day'})

// output
[
	{ day: 'Mo', times: [{ start: 1300, end: 1600 }, { start: 905, end: 1000 }] },
	{ day: 'Tu', times: [{ start: 1300, end: 1600 }] },
	{ day: 'Fr', times: [{ start: 905,  end: 1000 }] },
]

You can also request that the offerings be grouped like SIS does:

// input
course = {times: ['MT 0100-0400PM', 'MF 0905-1000']}

convertTimeStringsToOfferings(course, {groupBy: 'sis'})

// output
[
    { days: ['Mo', 'Tu'], times: [{start: 1300, end: 1600}] },
    { days: ['Mo', 'Fr'], times: [{start: 905,  end: 1000}] },
]
You can’t perform that action at this time.