Reference Source
public class | source

TimeUtility

You can directly use an instance of this class. TimeUtil

Utility class for time functions.

Method Summary

Public Methods
public

Returns the milliseconds time formatted as 'HH:MM - DD/MM/YY'.

public

Returns the current date and time in milliseconds.

public

Returns millisecond time as a time ago string (# __ ago).

public

Returns the milliseconds time as readable time (HH:MM:SS)

public

sortOnTime(data: List): List

Quick sorts the data based on the timeago property.

Public Methods

public getDateFormatFromDateTime(datetime: Number): string source

Returns the milliseconds time formatted as 'HH:MM - DD/MM/YY'.

Params:

NameTypeAttributeDescription
datetime Number

The time in milliseconds

Return:

string

Milliseconds represented as a string

public getDateTime(): Number source

Returns the current date and time in milliseconds.

Return:

Number

The date and time in milliseconds

public getTimeAgoFromMilliseconds(milliseconds: Number): string source

Returns millisecond time as a time ago string (# __ ago).

Params:

NameTypeAttributeDescription
milliseconds Number

The time in milliseconds

Return:

string

The millisecond time represented as a string

public parseMillisecondsIntoReadableTime(milliseconds: Number): string source

Returns the milliseconds time as readable time (HH:MM:SS)

Params:

NameTypeAttributeDescription
milliseconds Number

The time in milliseconds

Return:

string

Milliseconds formatted to time

public sortOnTime(data: List): List source

Quick sorts the data based on the timeago property. Arguably faster than using the built in sort function with a custom compare function.

Params:

NameTypeAttributeDescription
data List

Unsorted object data with a timeago property

Return:

List

Sorted data