Appearance
Timezones
DANGER
This document has not been updated since version 0.0.3 and is not ready for production. It will be updated before version 1.0 of the project is released.
The API uses structured timezone data for all timestamped computations.
The Timezone object
json
// timezone object
{
"id": "America\/Chicago",
"title": "America, Chicago",
"utc_offset": -18000,
"country_id": "US"
}
Read timezone
Retrieves the timezone object for the current session.account
.
Request
sh
GET /v1/static/timezone
Response
The Timezone object.
json
// timezone object
{
"id": "America\/Chicago",
"title": "America, Chicago",
"utc_offset": -18000,
"country_id": "US"
}
Enumerated timezones
Provides an enumerated collection of timezone data for HTML selects, radios, or similar listing elements.
Timezones are provided for the country of the current session.account
.
Request
sh
GET /v1/static/timezones/enumerated
Response
json
[
{
"id": "America\/Chicago",
"title": "America, Chicago"
},
...
]
Optionally, provide a custom value for the id
and/or title
property names in the query. In the example request, the response property names have been changed to value
and label
to eliminate mapping requirements in the frontend codebase.
Request
sh
GET /v1/static/timezones/enumerated
?id=value&title=label
Response
json
[
{
"value": "America\/Chicago",
"label": "America, Chicago"
},
...
]