Socket
Book a DemoInstallSign in
Socket

nusmoderator

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nusmoderator

A lightweight library with helpful functions for NUS-related matters

3.0.0
latest
Source
npmnpm
Version published
Weekly downloads
148
228.89%
Maintainers
5
Weekly downloads
 
Created
Source

NUSModerator

A lightweight library with helpful functions for NUS-related matters.

Installation

npm i nusmoderator -S
# or if you use yarn:
yarn add nusmoderator

API

Table of Contents

  • getAcadYearStartDate
  • getAcadYear
  • getAcadSem
  • getAcadWeekName
  • getAcadWeekInfo
  • getExamWeek

getAcadYearStartDate

Returns a Date object of the first weekday of Week 0 of that academic year. Assumes Week 0 begins on the first Monday of August.

Parameters

  • acadYear the academic year. E.g. "18/19"

Returns Date Start date of the academic year

getAcadYear

Takes in a Date and returns an object of acad year and start date for that year.

Parameters

Returns Object acadYearObject - { year: "15/16", startDate: Date }

getAcadSem

Computes the current academic semester. Expects a week number of a year.

Parameters

Examples

acadWeekNumber(3)

Returns string semester - "Semester 1"

getAcadWeekName

Computes the current academic week of the semester Expects a week number of a semester.

Parameters

Examples

acadWeekNumber(3)

Returns string semester - "Recess" | "Reading" | "Examination"

getAcadWeekInfo

Computes the current academic week and return in an object of acad date components

Parameters

Returns Object { year: "15/16", sem: 'Semester 1'|'Semester 2'|'Special Sem 1'|'Special Sem 2', type: 'Instructional'|'Reading'|'Examination'|'Recess'|'Vacation'|'Orientation', num: }

getExamWeek

Get the first day of the exam week for the given semester

Parameters

Returns Date

Keywords

NUS

FAQs

Package last updated on 11 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.