-
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
Editorial: DRY refactor of time formatting #2629
Editorial: DRY refactor of time formatting #2629
Conversation
630ff7a
to
281f1bc
Compare
Codecov Report
@@ Coverage Diff @@
## main #2629 +/- ##
==========================================
- Coverage 95.98% 95.96% -0.02%
==========================================
Files 20 20
Lines 11574 11528 -46
Branches 2201 2193 -8
==========================================
- Hits 11109 11063 -46
Misses 401 401
Partials 64 64
|
c409664
to
9f7e46d
Compare
@gibson042 - I expanded the scope of this PR to align with your feedback in #2607 (comment). I added a new Want to re-review this PR? Thanks! |
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.
Nice! I think I'd also like to see colon-vs.-empty-string separator parameterization (for FormatOffsetTimeZoneIdentifier), but that might be best placed in a followup.
9f7e46d
to
045c2c9
Compare
This editorial commit removes redundant spec text dealing with time formatting: * Adds a new AO FormatTimeString, and calls it in TemporalTimeToString, TemporalDateTimeToString, and TimeString (the legacy date AO in 262). * Removes FormatSecondsStringPart and replaces it with a new AO FormatFractionalSeconds, and call it in FormatTimeString and TemporalDurationToString. The text of this new AO is aligned with similar text in GetOffsetStringFor in tc39#2607. * Replaces sub-second formatting text in TemporalDurationToString with a call to FormatFractionalSeconds. * Aligns polyfill code to these spec changes. * Adjusts polyfill code in a few places to better match the spec. Note that this commit doesn't touch spec text for formatting time zone offsets because there are several in-flight PRs dealing with offsets and I wanted to keep this PR merge-conflict-free. But once those PRs land and the dust settles, then I'll send another editorial PR to DRY offset string formatting too, by using FormatTimeString to replace bespoke formatting text for offsets.
045c2c9
to
5fa747b
Compare
Yep, was gonna save that for the next PR after all the other normative offset-related PRs have landed. I made all the edits you recommended, so gonna merge this now. Thanks for your help! |
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that tc39#2629 started.
Simplify offset formatting by using FormatTimeString instead of bespoke formatting logic. This commit completes the time-formatting refactor that #2629 started.
…=allstarschh Implement the changes from <tc39/proposal-temporal#2629>. Differential Revision: https://phabricator.services.mozilla.com/D185410
…=allstarschh Implement the changes from <tc39/proposal-temporal#2629>. Differential Revision: https://phabricator.services.mozilla.com/D185410
This editorial PR removes redundant spec text dealing with time formatting:
Note that this PR doesn't touch spec text for formatting time zone offsets because there are several in-flight PRs dealing with offsets and I wanted to keep this PR merge-conflict-free. But once those PRs land and the dust settles, then I'll send another editorial PR to DRY offset string formatting too, by using FormatTimeString to replace bespoke formatting text for offsets.