-
Notifications
You must be signed in to change notification settings - Fork 721
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
1076: fromFormat should prefer the IANA zone if there are multiple zone specifiers #1082
1076: fromFormat should prefer the IANA zone if there are multiple zone specifiers #1082
Conversation
|
Could I get some help with the issue with the EasyCLA check?
I have just tried clicking the "NOT COVERED" button, and selecting the Corporate CLA option. I saw a message saying that this project does not support the Corporate CLA. Is that just an oversight? |
|
I'm just going to accept the CLA signature as-is. I think you've done it correctly; I'm not sure why the automation isn't accepting it. But it's good by me. The change itself I have some feedback on. So first, a mea culpa: I had misunderstood your question in the issue thread and answered too quickly. I didn't realize you were positioning it to use the numerical offset to interpret and then converting to the IANA zone. My mistake. I had in mind just changing the precedence to: let zone;
if (!isUndefined(matches.z)) {
zone = IANAZone.create(matches.z);
} else if (!isUndefined(matches.Z)) {
zone = new FixedOffsetZone(matches.Z);
} else {
zone = null;
} That's it; in other words, I'm suggesting totally ignoring the numerical offset. Looking at the tests, I think I see why you did the more elaborate change: it allows the parser to resolve ambiguous DST times using the offset. I can see the merits of that. But the semantics here are too complicated: using So here's a proposal to get the best of both worlds:
3 sounds hard but really isn't. Here's my version: #1083 |
@icambron Sorry I haven't gotten back to you sooner, I've gotten a bit distracted. I think your PR does make sense. I'd be tempted to go one step further and say that a timestamp with an offset that is completely different to the IANAZone should actually be invalid. However, I don't think I'll be dealing with timestamps like that in my situation, so I'd personally be happy if your PR was accepted as is. Should we reject this PR then? |
This PR is an attempt to address this issue: #1076
I've tried to take the approach of minimising modifications to the public API. I'm not completely confident in some of the changes this has led to, especially in the fromSQL function.