Namespace jsworld
Namespace container for the JsWorld library objects.
Defined in: <JsWorld.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
jsworld.formatIsoDate(d)
Formats a JavaScript Date object as an ISO-8601 date string.
|
| <static> |
jsworld.formatIsoDateTime(d, withTZ)
Formats a JavaScript Date object as an ISO-8601 date/time
string.
|
| <static> |
jsworld.formatIsoTime(d)
Formats a JavaScript Date object as an ISO-8601 time string.
|
| <static> |
jsworld.parseIsoDate(isoDateVal)
Parses an ISO-8601 formatted date string to a JavaScript
Date object.
|
| <static> |
jsworld.parseIsoDateTime(isoDateTimeVal)
Parses an ISO-8601 formatted date/time string to a JavaScript
Date object.
|
| <static> |
jsworld.parseIsoTime(isoTimeVal)
Parses an ISO-8601 formatted time string to a JavaScript
Date object.
|
Method Detail
<static>
{String}
jsworld.formatIsoDate(d)
Formats a JavaScript Date object as an ISO-8601 date string.
- Parameters:
- {Date} d Optional
- A valid JavaScript Date object. If undefined the current date will be used.
- Returns:
- {String} The date formatted as YYYY-MM-DD.
<static>
{String}
jsworld.formatIsoDateTime(d, withTZ)
Formats a JavaScript Date object as an ISO-8601 date/time
string.
- Parameters:
- {Date} d Optional
- A valid JavaScript Date object. If undefined the current date/time will be used.
- {Boolean} withTZ Optional
- Include timezone offset, default false.
- Returns:
- {String} The date/time formatted as YYYY-MM-DD HH:MM:SS.
<static>
{String}
jsworld.formatIsoTime(d)
Formats a JavaScript Date object as an ISO-8601 time string.
- Parameters:
- {Date} d Optional
- A valid JavaScript Date object. If undefined the current time will be used.
- Returns:
- {String} The time formatted as HH:MM:SS.
<static>
{Date}
jsworld.parseIsoDate(isoDateVal)
Parses an ISO-8601 formatted date string to a JavaScript
Date object.
- Parameters:
- {String} isoDateVal
- An ISO-8601 formatted date string.
Accepted formats:
- YYYY-MM-DD
- YYYYMMDD
- Throws:
- Error on a badly formatted date string or on a invalid date.
- Returns:
- {Date} The corresponding Date object.
<static>
{Date}
jsworld.parseIsoDateTime(isoDateTimeVal)
Parses an ISO-8601 formatted date/time string to a JavaScript
Date object.
- Parameters:
- {String} isoDateTimeVal
- An ISO-8601 formatted date/time string.
Accepted formats:
- YYYY-MM-DD HH:MM:SS
- YYYYMMDD HHMMSS
- YYYY-MM-DD HHMMSS
- YYYYMMDD HH:MM:SS
- Throws:
- Error on a badly formatted date/time string or on a invalid date.
- Returns:
- {Date} The corresponding Date object.
<static>
{Date}
jsworld.parseIsoTime(isoTimeVal)
Parses an ISO-8601 formatted time string to a JavaScript
Date object.
- Parameters:
- {String} isoTimeVal
- An ISO-8601 formatted time string.
Accepted formats:
- HH:MM:SS
- HHMMSS
- Throws:
- Error on a badly formatted time string.
- Returns:
- {Date} The corresponding Date object, with year, month and day set to zero.