TimeUtility
Utility class for time functions.
Method Summary
Public Methods | ||
public |
getDateFormatFromDateTime(datetime: Number): string Returns the milliseconds time formatted as 'HH:MM - DD/MM/YY'. |
|
public |
Returns the current date and time in milliseconds. |
|
public |
getTimeAgoFromMilliseconds(milliseconds: Number): string Returns millisecond time as a time ago string (# __ ago). |
|
public |
parseMillisecondsIntoReadableTime(milliseconds: Number): string 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:
Name | Type | Attribute | Description |
datetime | Number | The time in milliseconds |
public getTimeAgoFromMilliseconds(milliseconds: Number): string source
Returns millisecond time as a time ago string (# __ ago).
Params:
Name | Type | Attribute | Description |
milliseconds | Number | The time in milliseconds |
public parseMillisecondsIntoReadableTime(milliseconds: Number): string source
Returns the milliseconds time as readable time (HH:MM:SS)
Params:
Name | Type | Attribute | Description |
milliseconds | Number | The time in milliseconds |
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:
Name | Type | Attribute | Description |
data | List | Unsorted object data with a timeago property |
Return:
List | Sorted data |