-
Notifications
You must be signed in to change notification settings - Fork 153
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
Update obsolete legacy Date cookbook examples #1930
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1930 +/- ##
=======================================
Coverage 95.01% 95.01%
=======================================
Files 19 19
Lines 10940 10940
Branches 1732 1732
=======================================
Hits 10395 10395
Misses 530 530
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
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.
OK, I have some opinionated comments. 😄 The TL;DR is that a bad pattern from legacy Date is confusing UTC and local-TZ values, and we want to be really careful in our own docs (including cookbook) that we don't accidentally encourage the same confusion with Temporal.
f3e4938
to
53dfbc0
Compare
I found these 3 cookbook examples were out of date, and two of them were actually not included in the cookbook (but still executed together with the cookbook tests.) The examples were written before we had ZonedDateTime and also before we had Date.prototype.toTemporalInstant(). I've consolidated them into 2 files, "fromLegacyDate" and "toLegacyDate", and updated the accompanying explanations.
53dfbc0
to
530fa45
Compare
@justingrant I didn't incorporate all of the suggestions literally but instead rewrote the examples, and I think I got the spirit of your comments. I'd appreciate another look if you have time. |
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.
Much better! Looks great. Thanks!
I found these 3 cookbook examples were out of date, and two of them were
actually not included in the cookbook (but still executed together with
the cookbook tests.)
The examples were written before we had ZonedDateTime and also before we
had Date.prototype.toTemporalInstant().
I've consolidated them into 2 files, "fromLegacyDate" and "toLegacyDate",
and updated the accompanying explanations.