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

Consider adding ZonedDateTime.GetZoneInterval() convenience method. #211

Closed
GoogleCodeExporter opened this Issue Mar 15, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@GoogleCodeExporter

GoogleCodeExporter commented Mar 15, 2015

Hi, this is a friendly suggestion for a simple convenience method added to 
ZonedDateTime that allows you to get the TimeZoneInterval represented by the 
current state of the ZonedDateTime.  

What situation does this request make simpler?
Consider you want to get the abbreviated name of the timezone interval in a 
ZonedDateTime.  The best I can come up with using the API is:

myZonedDateTime.Zone.GetZoneInterval(myZonedDateTime.ToInstant()).Name

It doesn't feel right having to involve the two accesses to ZonedDateTime to 
piece together something that ZonedDateTime already has the internal values to 
know how to do.

Can you provide a straw-man example of what you'd want the API to look
like?
This would be simpler if it could look like:  

myZonedDateTime.GetZoneInterval().Name

In my opinion, this would also aid in "self-documenting" and helping people 
learn the API, just a tiny bit.
Please also see: http://stackoverflow.com/a/15959880/390906

I'm willing to submit a change if this receives architectural approval.

Original issue reported on code.google.com by BrandonLWhite on 16 Apr 2013 at 7:25

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Mar 15, 2015

Sounds good to me. I'd even be tempted to make it a property.

Original comment by jonathan.skeet on 16 Apr 2013 at 7:28

GoogleCodeExporter commented Mar 15, 2015

Sounds good to me. I'd even be tempted to make it a property.

Original comment by jonathan.skeet on 16 Apr 2013 at 7:28

@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Mar 15, 2015

Original comment by jonathan.skeet on 16 Apr 2013 at 7:28

  • Changed state: Accepted
  • Added labels: Type-Enhancement, Priority-Medium, Milestone-1.2.0

GoogleCodeExporter commented Mar 15, 2015

Original comment by jonathan.skeet on 16 Apr 2013 at 7:28

  • Changed state: Accepted
  • Added labels: Type-Enhancement, Priority-Medium, Milestone-1.2.0
@GoogleCodeExporter

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Mar 15, 2015

This issue was closed by revision b450a6f6366b.

Original comment by jonathan.skeet on 19 Apr 2013 at 2:27

  • Changed state: Fixed

GoogleCodeExporter commented Mar 15, 2015

This issue was closed by revision b450a6f6366b.

Original comment by jonathan.skeet on 19 Apr 2013 at 2:27

  • Changed state: Fixed

@malcolmr malcolmr modified the milestone: 1.2.0 Mar 15, 2015

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