Skip to content
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

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

gibson042
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #2514 (0ea7adb) into main (500bbf3) will not change coverage.
The diff coverage is n/a.

❗ Current head 0ea7adb differs from pull request most recent head 120e9b1. Consider uploading reports for the commit 120e9b1 to get more accurate results

@@           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.

Copy link
Collaborator

@justingrant justingrant left a 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!

docs/zoneddatetime.md Outdated Show resolved Hide resolved
@@ -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).
Copy link
Collaborator

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!

@gibson042 gibson042 enabled auto-merge (squash) March 3, 2023 22:21
@gibson042 gibson042 merged commit ba71363 into tc39:main Mar 3, 2023
Aditi-1400 pushed a commit to Aditi-1400/proposal-temporal that referenced this pull request Mar 7, 2023
…39#2514)

* Correct false claim about ZonedDateTime.prototype.equals
* Correct false example for ZonedDateTime.compare
* Clarify and improve cross-type alignment of ZonedDateTime.compare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants