Class: time

time()

new time()

Source:

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

getRegistrationMessage(ts, genderopt) → {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

getTimeAgoDelta(timestamp) → {Object}

Calculate the correct unit of timestamp delta

Parameters:
Name Type Description
timestamp number
Source:
Returns:
Type
Object

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

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

timeAgo(timestampDelta) → {Object}

Calculate the correct unit of timestamp

Parameters:
Name Type Description
timestampDelta number
Source:
Returns:
Type
Object