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

Add check for etc zone support before using for formatting #918

Merged

Conversation

durasj
Copy link
Contributor

@durasj durasj commented Apr 8, 2021

This fixes issues like #912 and #883.

  • Instead of checking only if the range is likely supported, the zone is really tested before it is used. While this will have likely some performance impact, I cannot think of some other reliable way to do this.
  • TZ used for formatting when the offset is 0 is UTC. This will fix issues like toFormat('ttt') returns GMT instead of UTC #878 because it'll revert things to the previous behaviour. It is not ideal, because if somebody uses explicit GMT it still becomes UTC, but AFAIK FixedOffsetZone doesn't hold the original name so this is the best that can be done.

@durasj durasj changed the title Add check for etc zone support before use Add check for etc zone support before using for formatting Apr 8, 2021
@icambron icambron merged commit 88eae19 into moment:master May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants