Namespace SS.datetime
SS.datetime Date/Time Functionality
Defined in: SS.datetime.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
SS.datetime.formats
Defined date / time formats.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
SS.datetime.difference(d1, d2, f)
Calculates the positive floored difference between two dates.
|
| <static> |
SS.datetime.format(d, f, lc)
Formats the Date object given into the specified format
|
| <static> |
SS.datetime.fromString(s, df, d)
Takes a string input and returns its date/time representation as a date object
|
| <static> |
SS.datetime.getFormat(dt, df)
Returns the format that the date / time is in.
|
| <static> |
SS.datetime.milliseconds(ms, f)
Formats the number of milliseonds into a date/time string format
|
| <private> <static> |
SS.datetime.preFormat(f)
Takes a date/time format string and replaces the
friendly format codes with program specific codes
to ensure the date is rendered correctly as a string.
|
Field Detail
<static>
SS.datetime.formats
Defined date / time formats.
Method Detail
<static>
{Integer, String>}
SS.datetime.difference(d1, d2, f)
Calculates the positive floored difference between two dates.
If no format is specified, returns number of milliseconds as number.
- Parameters:
- {Date} d1
- First date to compare
- {Date} d2
- Second date to compare
- {String} f
- Format - format to return the difference in. Default is milliseonds if not specified.
ms : milliseconds
s : seconds
mi : minutes
h : hours
d : days
mo : months
y : years
- Returns:
- {Integer} Difference as {Integer} if format is not specified.
- {String>} Difference in requested format.
<static>
SS.datetime.format(d, f, lc)
Formats the Date object given into the specified format
- Parameters:
- {Date} d
- Date to be formatted
- {String} f
- Format the date based on this string
- {SS.locale} lc
- Locale: use a specified locale object
<static>
{Date}
SS.datetime.fromString(s, df, d)
Takes a string input and returns its date/time representation as a date object
- Parameters:
- {String} s
- Date/Time String
- {String} df
- Default date format(df) the date/time should be when encountering ambigous dates e.g. 03/02/2009 could be 2nd March 2009 (MM/dd/yyyy) or 3rd February 2009 (dd/MM/yyyy).
If df is not specified then the locale default will be used. If this has not be defined then "MM/dd/yyyy" will be used as the default date format. - d
- Returns:
- {Date} If unable to parse date/time passed, null is returned.
<static>
{String}
SS.datetime.getFormat(dt, df)
Returns the format that the date / time is in.
If not match found, returns null.
- Parameters:
- {String} dt
- Date time string.
- {String} df
- Default date format(df) the date/time should be when encountering ambigous dates e.g. 03/02/2009 could be 2nd March 2009 (MM/dd/yyyy) or 3rd February 2009 (dd/MM/yyyy).
"MM/dd/yyyy" = Default date format.
If not specified, then all matches are returned.
- Returns:
- {String} - Date / time format (if only one match found or defaultFormat specified) OR {Array} array[string,string,...] array of date time formats matched.
<static>
{String}
SS.datetime.milliseconds(ms, f)
Formats the number of milliseonds into a date/time string format
- Parameters:
- {Integer} ms
- Millisecond number to be formatted
- {String} f
- Format the date based on this string.
- Returns:
- {String} Formatted string.
<private> <static>
SS.datetime.preFormat(f)
Takes a date/time format string and replaces the
friendly format codes with program specific codes
to ensure the date is rendered correctly as a string.
- Parameters:
- {String} f
- Date/time format string
