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

Why is DateTime.zone private? #368

Closed
DanielSWolf opened this issue Nov 16, 2018 · 3 comments
Closed

Why is DateTime.zone private? #368

DanielSWolf opened this issue Nov 16, 2018 · 3 comments

Comments

@DanielSWolf
Copy link
Contributor

Each DateTime instance has an associated time zone in its zone field. There is a method setZone for changing the zone (in a clone). But there is no "official" way to read that Zone object because DateTime.zone is marked as @access private. Accordingly, the TypeScript type definitions at DefinitelyTyped don't include this member.

Is there a reason for not allowing access to this time zone?

@icambron
Copy link
Member

Yeah, per the other ticket, that's the unsupported way you could accomplish creating an IANA zone by name. It's private just because I didn't see a compelling need, and the smaller the interface, the less chance of bugs or misunderstandings, and the more I can change things without breaking people's code. So what I would need to change it is a compelling use case for making it public.

@DanielSWolf
Copy link
Contributor Author

@icambron I added an explanation to the related issue #369.

DanielSWolf added a commit to DanielSWolf/luxon that referenced this issue Jan 10, 2019
@icambron
Copy link
Member

Fixed in #404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants