Expand all

mobile.startup/time

Utility library for relative time.

Methods

getLastModifiedMessage(ts, username, gender, historyUrl) → {string} #

Return a message relating to the last modified relative time.

Parameters:

Name Type Description
ts number

timestamp

username string

of the last user to modify the page

gender string

of the last user to modify the page

historyUrl string

url to the history page for the message (deprecated)

Source:

Returns:

Type
string
Return a message relating to the last modified relative time.

getRegistrationMessage(ts, [gender]) → {string} #

Return a message relating to the registration date of the user

Parameters:

Name Type Attributes Description
ts string

timestamp

gender string optional

of the last user editing this page

Source:

Returns:

Type
string
Return a message relating to the registration date of the user

isNow(delta) → {boolean} #

Is delta less than 10 seconds?

Parameters:

Name Type Description
delta Object

Object of timestamp and its label

Source:

Returns:

Type
boolean
Is delta less than 10 seconds?

isRecent(delta) → {boolean} #

Whether timestamp delta is less than a day old

Parameters:

Name Type Description
delta Object

Object of timestamp and its label

Source:

Returns:

Type
boolean
Whether timestamp delta is less than a day old

timeAgo(timestampDelta) → {Object} #

Calculate the correct unit of timestamp

Parameters:

Name Type Description
timestampDelta number
Source:

Returns:

Type
Object
Calculate the correct unit of timestamp

getTimeAgoDelta(timestamp) → {Object}static #

Calculate the correct unit of timestamp delta

Parameters:

Name Type Description
timestamp number
Source:

Returns:

Type
Object
Calculate the correct unit of timestamp delta