![]()
Enumeration used to identify time units internally.
Constants:
|
Code » |
Accepts a timestamp in milliseconds and outputs a relative time in the form
of "1 hour ago", "1 day ago", "in 1 hour", "in 2 days" etc. If the date
delta is over 2 weeks, then the output string will be empty.
|
code » | |||||
Accepts a timestamp in milliseconds and outputs a relative day. i.e. "Today",
"Yesterday", "Tomorrow", or "Sept 15".
|
code » | |||||
Returns a date in full date format, e.g. Tuesday, March 24, 2009.
Arguments:
Returns: string
The formatted string.
|
code » | |||||
Returns a date in month format, e.g. Mar 15.
|
code » | |||||
Accepts a timestamp in milliseconds and outputs a relative time in the form
of "1 hour ago", "1 day ago". All future times will be returned as 0 minutes
ago.
This is provided for compatibility with users of the previous incarnation of
the above method who relied on it protecting against
future dates.
|
code » | |||||
Returns a date in short-time format, e.g. 2:50 PM.
Arguments:
Returns: string
The formatted string.
|
code » | |||||
![]()
Handles formatting of time deltas.
|
code » | |||||
Formats a date, adding the relative date in parenthesis. If the date is less
than 24 hours then the time will be printed, otherwise the full-date will be
used. Examples:
2:20 PM (1 minute ago)
Monday, February 27, 2009 (4 days ago)
Tuesday, March 20, 2005 // Too long ago for a relative date.
Arguments:
Returns: string
The date string in the above form.
|
code » | |||||
![]()
Formats a date, adding the relative date in parenthesis. If the date is less
than 24 hours then the time will be printed, otherwise the full-date will be
used. Examples:
2:20 PM (1 minute ago)
Monday, February 27, 2009 (4 days ago)
Tuesday, March 20, 2005 // Too long ago for a relative date.
Arguments:
Returns: string
The date string in the above form.
|
code » | |||||
Gets a localized relative date string for a given delta and unit.
|
code » | |||||
Formats a date, adding the relative date in parenthesis. Functions the same
as #getDateString but ensures that the date is always seen to be in the past.
If the date is in the future, it will be shown as 0 minutes ago.
This is provided for compatibility with users of the previous incarnation of
the above method who relied on it protecting against
future dates.
Arguments:
Returns: string
The date string in the above form.
|
code » | |||||
![]()
Sets a different formatting function for time deltas ("3 days ago").
While its visibility is public, this function is Closure-internal and should
not be used in application code.
Arguments:
|
code » |