-
Notifications
You must be signed in to change notification settings - Fork 7k
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
deprecate isDSTShifted #3160
deprecate isDSTShifted #3160
Conversation
I think it was added for newly created moment objects. I'm pretty sure moment-timezone could provide the same information. So if it could be fixed for newly made moments for both regular and moment timezone I prefer to keep it, with proper docs. If not we can deprecate if of course. |
Definitely, when I wrote this function, I had in mind the parsing case. I think that I thought that because the This is the kind of thing that makes me want immutability. That said, Moment is definitely mutable and if we can't make it work for mutated moments, I'm +1 on removing it. I think the it-works-except-when-you-do-these-otherwise-supported-things thing is too subtle and documenting it doesn't really fix the issue. I do think this is fixable, though! Specifically, @timrwood's TZ interface changes provide the answer because |
Yeah, agreed. It's too easily confused with The idea is nice, and is similar in concept to |
Actually, the current PR looks fine to me, assuming the guides page matches the URL listed. |
Merged in 3227fff |
Not sure if the group will agree on this one, but I think we should just deprecate isDSTShifted.
It doesn't work for moments that have been mutated (#2942), it doesn't work with moments using moment timezone (moment/moment-timezone#131), because it relies on browser behavior, it can't be unit tested, and it's confusing: http://stackoverflow.com/questions/36939900/moment-timezone-utc-offset-difference
IIRC @mj1856 and I have both looked at this function and tried to come up with a way to fix it. I think we both concluded that due to issues with overflow, it wasn't really feasible. Or maybe Matt looked at something else related to DST - I'm not sure.
It's possible there's a way to fix it, I'm open to suggestion. But if nobody is going to fix it, and it doesn't work, it doesn't make sense to keep it.
I know I added a link to a webpage that doesn't exist in that deprecation warning. If we decide to merge this I'll update docs.