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
s/zone/offset #1779
Comments
To be honest I don't know what is the correct definition of zone. It might be an offset, or a complete ruleset of offsets. When you say EET (Eastern European Time), that is considered a The rules for when to use which is not called a zone (http://www.timeanddate.com/time/change/greece/athens for example). Its more like when to change zones because of DST. So I'd name them Also |
I agree about the named-offset-vs-DST-rules ambiguity, but Moment doesn't support either of those, just a numerical offset. So it still seems like we should switch to the nice, unambiguous concept of "offset", whether perhaps you could really call it a "zone" or not. The complication, I guess, is that it is actually also switching the The real answer is of course to get rid of DSTs. |
In fact, it might be wiser to rename |
+1 for switching to |
So right now there are 3 functions for dealing with these. So renaming zone to |
Yeah - I've probably been one of the more vocal ones on the interwebs about "Time Zone != Offset".... :) From a technical perspective, I think the term "time zone" is a bit ambiguous. It could be used to describe any of:
From a practical perspective though, I've been encouraging others to choose their words more carefully. I probably get this from DDD practices, where ubiquitous language is a key concept. IMHO, the term "time zone" should be used for describing the entire geographic area, such that they apply without regard to any particular point in time. So "Pacific Time" or "PT" are appropriately called "time zones". So might "America/Los_Angeles" be called a "time zone", but also might be more specifically called a "time zone identifier". I try to always call values like UTC-8 either an "offset", or a "time zone offset", and call out that a single "time zone" may have one or more "offsets" in their annual usage, or in their history. Values like "Pacific Standard Time" (PST) are a bit trickier from a naming perspective. I think the best term I've heard for these is "time zone segment". I do agree though - if you're making breaking changes, rename |
Getting OT, but the terminology I prefer is that PST is a "named offset"; i.e. it's just an alias for UTC-8 with a somewhat useful name that also implies that you're in PT. I agree that PT is a zone for the same reason you do, but of course it's a) an ambiguous name and b) not amenable to change (what do we call it when SF decides to have its own time zone?). America/Los_Angeles as "time zone identifier" seems fine, but I also don't mind just calling it a zone, since it's the unambiguous name for a set of rules. Edit: another way to put that is that PT is a "common name" for America/Lost_Angeles. |
This would also be the perfect time to fix this issue. moment/moment-timezone#56 (comment) Because |
Agreed about #56. |
OK, so how about:
Note: Not sure if we should use |
@ichernev, that all looks good to me. We may want to EST as a named alias for |
According to this there is no EST in Australia. |
See moment/moment-timezone#108 and eggert/tz@62df86e#diff-7a413a97538e4a2a88ec6c08dd067830R869. They are changing, but that's just one example of a name not being unique to a offset. I haven't checked other named offsets, but I'm guessing it happens in other places as well. |
Close in favor of #2074 |
get rid of deprecation warning `Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. moment/moment#1779
get rid of deprecation warning "Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. moment/moment#1779"
Now we have |
Update moment.js to the latest; According to moment/moment#1779, change zone() to utcOffset()
Remove Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. moment/moment#1779
This is the message I get when running my app. I don't use the zone method at all in my app, so why am I getting a warning about it? |
@samholmes - hard to say without seeing an example. Perhaps you have some other dependency that uses it? If you can post a jsFiddle or similar that reproduces the message, I'd be happy to investigate. Otherwise, dive in to your browser's debugging tools and check the stack trace to see what's making the call to that function. |
$ npm list moment
SECRET@0.0.0 /Users/holmes/Code/SECRET/app
├─┬ cron@1.0.6
│ └─┬ moment-timezone@0.2.4
│ └── moment@2.9.0
└── moment@2.9.0 Is this a 2.9.0 problem? |
@samholmes - This looks like the same as moment/moment-timezone/issues/228. I see you're using moment-timezone 0.2.4. I can also see that cron 1.0.6 took a hard dependency on moment-timezone version 0.2.4, but in the current version it asks for Therefore, updating to the latest cron and moment versions should fix the issue. |
I changed the the zone to utcOffset in my implementation but I still get the deprecation error. What can I do to avoid that. I made sure that aren't any .zone() calls in my implementatioin. |
@robertdumitrescu search your code. Or put it somewhere we can search and give a URL. Not sure what else I could suggest. |
get rid of deprecation warning "Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. moment/moment#1779"
`cron` was using `.tz` which was recently deprecated in moment/moment#1779. This commit fixes the deprecation notice that `moment` was throwing.
While we're deprecating and renaming things, maybe it's time to be consistent with our use of "zone" and "offset"? I'm kind of tired of explaining that
moment.zone()
isn't quite what it says on the tin, and I'm almost sure @mj1856 is too. What do you think, @ichernev?The text was updated successfully, but these errors were encountered: