-
Notifications
You must be signed in to change notification settings - Fork 838
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
Functions to get next/last DST transitions #266
Comments
It would be awesome |
You could easily achieve this by getting the moment.tz.zone().untils nearest to current UTC time |
Updated the original description. This can all go into moment-timezone, and should use the functions we created as part of the |
Is this still needed? The stack overflow thread no longer exists, so I'm not sure about what the requirements/context are. Otherwise would love to take this task if not too complex (this would be my first PR to moment js). Thanks!! |
@petrgazarov - Yes, it's still needed. The example in the S.O. thread was: moment().tz('Europe/Paris').getNextDST(); I'm not sure that's the exact API that we'd want, but something like that. A proposal would be welcome. |
@mj1856 I would like to work on this issue, where can I hook the new function? |
can you add these Functions to the Zone Object? So I can do moment.ts.zone('Europe/Berlin').getNextTransition(date).isDST() |
Yes, you should be able to hook the zone. |
From StackOverflow.
It would be nice to have
getNextTransition
and related functions.The function should go in moment proper first, where it will need to scan the local environment's time zone.Then it can be hooked into moment-timezone such that we use the
untils
array of a specific time zone.The text was updated successfully, but these errors were encountered: