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)

Returns:

Type
string
Source:
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

Returns:

Type
string
Source:
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

Returns:

Type
boolean
Source:
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

Returns:

Type
boolean
Source:
Whether timestamp delta is less than a day old

timeAgo(timestampDelta) → {Object} #

Calculate the correct unit of timestamp

Parameters:

Name Type Description
timestampDelta number

Returns:

Type
Object
Source:
Calculate the correct unit of timestamp

getTimeAgoDelta(timestamp) → {Object}static #

Calculate the correct unit of timestamp delta

Parameters:

Name Type Description
timestamp number

Returns:

Type
Object
Source:
Calculate the correct unit of timestamp delta