Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChromeTime

Time Class

Hierarchy

  • ChromeTime

Index

Constructors

constructor

  • new ChromeTime(timeString?: undefined | string): ChromeTime
  • Create a new Time

    Parameters

    • Optional timeString: undefined | string

      optional in '00:00' format, otherwise use current time

    Returns ChromeTime

Properties

Private _hr

_hr: number

hour in 24 hour format

Private _min

_min: number

minute

Accessors

Static MIN_IN_DAY

  • get MIN_IN_DAY(): number
  • Minutes in day

    Returns number

Static MIN_IN_HOUR

  • get MIN_IN_HOUR(): number
  • Minutes in hour

    Returns number

Static MSEC_IN_DAY

  • get MSEC_IN_DAY(): number
  • Milliseconds in day

    Returns number

Static MSEC_IN_HOUR

  • get MSEC_IN_HOUR(): number
  • Milliseconds in hour

    Returns number

Static MSEC_IN_MIN

  • get MSEC_IN_MIN(): number
  • Milliseconds in minute

    Returns number

Methods

Private parse

  • parse(timeString: string | undefined): void
  • Parse time string

    Parameters

    • timeString: string | undefined

      in '00:00' format

    Returns void

toString

  • toString(format: number): string
  • Get string representation of Time

    Parameters

    • format: number

      time format

    Returns string

    As string

Static getStringFull

  • getStringFull(timeString: string, format: number): string
  • Get time as string suitable for display, including AM/PM if 12hr

    Parameters

    • timeString: string

      in '00:00' format

    • format: number

      time format

    Returns string

    display string

Static getStringShort

  • getStringShort(format: number): string
  • Get current time suitable for display w/o AM/PM if 12hr

    Parameters

    • format: number

      = time format

    Returns string

    display string

Static getTime

  • getTime(timeString: string): number
  • Convert string to current time

    Parameters

    • timeString: string

      in '00:00' format

    Returns number

    time in milliSeconds from epoch

Static getTimeDelta

  • getTimeDelta(timeString: string): number
  • Calculate time delta from now on a 24hr basis

    Parameters

    • timeString: string

      in '00:00' format

    Returns number

    time delta in minutes

Static Private is24Hr

  • is24Hr(format: number): boolean
  • Determine if user wants 24 hr time

    Parameters

    • format: number

      time format

    Returns boolean

    true for 24 hour time

Static isInRange

  • isInRange(start: string, stop: string): boolean
  • Determine if current time is between start and stop, inclusive

    Parameters

    • start: string

      in '00:00' format

    • stop: string

      in '00:00' format

    Returns boolean

    true if in the given range

Generated using TypeDoc