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

Validate specified timezone against IANA database #8832

Closed
jmooring opened this issue Jul 31, 2021 · 2 comments
Closed

Validate specified timezone against IANA database #8832

jmooring opened this issue Jul 31, 2021 · 2 comments

Comments

@jmooring
Copy link
Member

Case 1: Site Configuration

If an invalid timeZone is specified in the site configuration, the failure is silent. Example:

timeZone = "America/LosAngeles"   # Should be America/Los_Angeles

Case 2: Time Function

If an invalid timezone is specified as the optional second argument to the time function, the failure is also silent (the build continues without error or warning). However, the error is rendered on the page (easy to miss and then inadvertently deploy). Example:

{{ time "2020-07-31T09:29:26" "America/LosAngeles" }}

This renders:

unknown time zone America/LosAngeles
@bep bep added Enhancement and removed Proposal labels Jul 31, 2021
@bep bep added this to the v0.87 milestone Jul 31, 2021
@bep
Copy link
Member

bep commented Aug 1, 2021

The second case above is #8835 -- I separated that into its own issue, because that is more general and technical. We do return an error on invalid timezone in time.AsTime, but due to some technical mumbo jumbo, that error does not transform into a real error when you use the short form time.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants