Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document timezone key #4

Merged
merged 2 commits into from Jan 15, 2021
Merged

Document timezone key #4

merged 2 commits into from Jan 15, 2021

Conversation

vkrause
Copy link
Member

@vkrause vkrause commented Jan 8, 2021

No description provided.

readme.md Outdated Show resolved Hide resolved
readme.md Outdated

For endpoints that return results without any indication of the timezone its dates and times refer to,
the `timezone` field should contain an IANA timezone identifier. Endpoints providing this in some form
(e.g. as UTC offsets) should not have this property set, in particular if their results can span multiple
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because an endpoint returned e.g. a date+time with +02:00 offset, that does not mean that clients should always just display this value as-is. They should IMO have the possibility to compute the current local wall clock time for the endpoints main area of operation if they desire. Having the additional timezone information (note that this is different from timezone offset information), they can deliver more helpful UX, e.g. when travelling from one timezone to another, or during a DST switch.

This is why I think that, whenever it's possible to noninate a single timezone (identifier) for an endpoint, it should be put here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I was thinking too much about cross-timezone endpoints when writing that part.
Having looked a bit deeper into what we currently use this for there is actually an important part missing here: the timezone in which request times have to be specified in, which makes this required pretty much all the time.

Do we want to have that in two different properties (e.g. requestTimezone and resultTimezone), with the first one being mandatory for all protocols that don't allow specifying a timezone in the request (AFAIK that's all of them), while the latter is required for any endpoint that does not have any kind of timezone information in the results at all, and is recommended for any endpoint who only covers a single timezone?

I can't think of a case where both values would differ, but there are cases where results can be fully qualified (Navitia, OTP) and this the result timezone shouldn't be overridden.

We could also leave that to the client and fold both together in a single timezone property, which then would practically be mandatory for all endpoints.

readme.md Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
Co-authored-by: Jannis Redmann <mail@jannisr.de>
@derhuerst derhuerst merged commit fcf668c into v1 Jan 15, 2021
@derhuerst derhuerst deleted the document-timezone branch January 15, 2021 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants