Class: Time

Time

Time Class


new Time( [timeString])

Create a new Time

Parameters:
Name Type Argument Default Description
timeString string <optional>
<nullable>
null

in '00:00' format, if null use current Date

Properties:
Name Type Description
_hr int

24 hour time

_min int

minutes

Source:

Members


<static> MIN_IN_DAY

Minutes in day

Source:

<static> MSEC_IN_DAY

Milliseconds in day

Source:

Methods


<private, static> _is24Hr( [frmt]) → {boolean}

Determine if user wants 24 hr time

Parameters:
Name Type Argument Default Description
frmt int <optional>
<nullable>
null

optional format, overrides storage value

Source:
Returns:

true for 24 hour time

Type
boolean

<static> getStringFull(timeString [, frmt]) → {string}

Get time as string suitable for display, including AM/PM if 12hr

Parameters:
Name Type Argument Default Description
timeString string

in '00:00' format

frmt int <optional>
<nullable>
null

optional format, overrides storage value

Source:
Returns:

display string

Type
string

<static> getStringShort() → {string}

Get current time suitable for display w/o AM/PM if 12hr

Source:
Returns:

display string

Type
string

<static> getTime(timeString) → {int}

Convert string to current time

Parameters:
Name Type Description
timeString string

in '00:00' format

Source:
Returns:

time in milliSeconds from epoch

Type
int

<static> getTimeDelta(timeString) → {int}

Calculate time delta from now on a 24hr basis

Parameters:
Name Type Description
timeString string

in '00:00' format

Source:
Returns:

time delta in minutes

Type
int

<static> isInRange(start, stop) → {boolean}

Determine if current time is between start and stop, inclusive

Parameters:
Name Type Description
start string

in '00:00' format

stop string

in '00:00' format

Source:
Returns:

true if in the given range

Type
boolean

<private> _parse(timeString)

Parse time string

Parameters:
Name Type Description
timeString string

in '00:00' format

Source:

toString( [frmt]) → {string}

Get string representation of Time

Parameters:
Name Type Argument Default Description
frmt int <optional>
<nullable>
null

optional format, overrides storage value

Source:
Returns:

As string

Type
string