-
Notifications
You must be signed in to change notification settings - Fork 158
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
Docs: Fix incorrect explanations and examples about ZonedDateTime #2514
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2514 +/- ##
=======================================
Coverage 95.49% 95.49%
=======================================
Files 20 20
Lines 10923 10923
Branches 2031 2031
=======================================
Hits 10431 10431
Misses 430 430
Partials 62 62 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only one minor suggestion. Thanks!
@@ -1224,7 +1223,7 @@ Compares two `Temporal.ZonedDateTime` objects for equality. | |||
This function exists because it's not possible to compare using `zonedDateTime == other` or `zonedDateTime === other`, due to ambiguity in the primitive representation and between Temporal types. | |||
|
|||
If you don't need to know the order in which two events occur, then this function is easier to use than `Temporal.ZonedDateTime.compare`. | |||
But both methods do the same thing, so a `0` returned from `compare` implies a `true` result from `equals`, and vice-versa. | |||
However, there are subtle differences between the two methods—a `true` result from `equals` includes comparison of calendar and time zone, and is therefore stronger than a `0` result from compare (which ignores calendar and time zone). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. The old docs were how it used to work before we were required to switch to the current behavior as a condition of getting Stage 3!
…39#2514) * Correct false claim about ZonedDateTime.prototype.equals * Correct false example for ZonedDateTime.compare * Clarify and improve cross-type alignment of ZonedDateTime.compare
No description provided.