Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Time

classdesc

The Time class stores HH:MM times and provides time arithmetic functions for it.

Hierarchy

  • Time

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Time(arraytime: number[]): Time
  • Parameters

    • arraytime: number[]

      Array of two integers representing the hours and minutes, respectively. This value is stored by reference.

    Returns Time

Properties

arraytime

arraytime: number[]

Array of two integers representing the hours and minutes, respectively.

h

h: number

The hours as an integer.

m

m: number

The minutes as an integer.

Methods

toDate

  • toDate(): Date

toMinutes

  • toMinutes(): number
  • Convert the current time to total minutes. Eg, if the time is 1:00, toMinutes() returns 60.

    Returns number

toString

  • toString(): string
  • Returns a string representation of the current time as AM/PM time. Eg, if the time is 13:28 the return value will be "1:28pm"

    Returns string

Generated using TypeDoc