-
Notifications
You must be signed in to change notification settings - Fork 837
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 getNextDST() and getLastDST() functions #431
base: develop
Are you sure you want to change the base?
Conversation
I saw this locally too - not sure why the tests are failing. If you run |
please hook is to the Zone Object, and name the functions getNextTransition and getPreviousTransition because not all Transitions are DST Transitions. |
574d3fb
to
51be029
Compare
51be029
to
65d3629
Compare
What's the status of this feature? (I'm not too familiar with the way changes are progressed in a library such as this.) I'd love to see these functions implemented, not only the next DST transition relative to now, but the next one relative to a specified UTC time. Are they in a beta version or anything? I could knock something up for my own purposes using |
Hey @drmrbrewer, sorry about the delay. If you would like to take this on, I believe the feature is complete on my branch. Just need to pass tests. Thanks! |
+1 |
If it's just a for loop over some offsets, it could be done as a binary search (maybe not worth it if the changes are less than 100). I'm not sure the |
@ichernev I was searching for a project to contribute to, all these open pull requests weren't published because there are some problems in the code, right? So that means if someone will fix it - it will be merged? |
Resolves #266.
Adds
getNextDST()
andgetLastDST()
ontz
with an option to pass in a date or moment object as an argument (to be used as benchmark when calculating the result). If no argument is given, compares to current time of theguess()
ed zone.Would be happy to add docs once code is approved. Thanks!