-
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
Flip Zone.offset, rename as Zone.utcOffset #397
Comments
This is fairly trivial. A PR would be welcome. Note, we are just talking about the function. Do not change the |
Hi. I am trying to replace the deprecated function, but there is something I do not understand. The following code prints the same offset for both const moment = require("moment-timezone");
let zone = null;
zone = moment.tz.zone("America/New_York");
console.log(zone.offset(Date.now()));
console.log(zone.utcOffset(Date.now()));
zone = moment.tz.zone("Asia/Tokyo");
console.log(zone.offset(Date.now()));
console.log(zone.utcOffset(Date.now())); |
@maggiepint, I'm sorry. Maybe I don't get something, but what was the point to approve PR if the feature is not ready yet? now I get this warnings everywhere but I can't fix them until momentjs will fix invert sign bug :-( |
So is this safe to use or not? Should I keep |
once this gets fixed it will necessitate a major version bump since otherwise |
Hey maintainers... Any updates one this? |
Hey maintainers... Any updates one this? |
Would like to hear any updates? |
Daylight savings time ending reminded me that we're still waiting on an update for this. @maggiepint @ellenaua |
The
offset
function on theZone
class returns positive values west of UTC instead of east like normal. We had something similar with thenmoment.zone
function, which was deprecated in favor ofmoment.utcOffset
.We should do the same with the
Zone
object. Theoffset
function should be deprecated, and autcOffset
function should be added, which returns the same value with the sign inverted.The text was updated successfully, but these errors were encountered: