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

Sub-minute time zone offsets #1035

Merged
merged 3 commits into from
Oct 22, 2020
Merged

Sub-minute time zone offsets #1035

merged 3 commits into from
Oct 22, 2020

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Oct 22, 2020

Closes: #935

This is necessary for round-tripping of some named time zones. In
particular we are testing with Europe/Amsterdam before 1937.

See: #935
Allows time zone offsets such as +00:19:32.13 in Temporal.Instant.from,
Temporal.TimeZone.from, and new Temporal.TimeZone.

See: #935
@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #1035 into main will decrease coverage by 0.00%.
The diff coverage is 97.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1035      +/-   ##
==========================================
- Coverage   94.33%   94.33%   -0.01%     
==========================================
  Files          18       18              
  Lines        6404     6420      +16     
  Branches      950      959       +9     
==========================================
+ Hits         6041     6056      +15     
- Misses        356      357       +1     
  Partials        7        7              
Flag Coverage Δ
#test262 46.92% <71.42%> (+0.04%) ⬆️
#tests 90.36% <95.74%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/ecmascript.mjs 96.09% <97.61%> (-0.01%) ⬇️
polyfill/lib/regex.mjs 100.00% <100.00%> (ø)
polyfill/lib/timezone.mjs 95.16% <100.00%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cef7855...7771b92. Read the comment docs.

const zone = new Temporal.TimeZone('Europe/Amsterdam');
const inst = Temporal.Instant.from('1900-01-01T12:00Z');
const dtm = Temporal.DateTime.from('1900-01-01T12:00');
it(`${zone} has ID ${zone}`, () => equal(zone.id, `${zone}`));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A feel a bit iffy about comparing two computed values, one of these should ideally be a constant, otherwise they could both be the wrong yet the same and it would pass. That said, it's a very minor nit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already the case in the other tests surrounding this one, but maybe it's worth a follow up issue if you want to open one?

@ryzokuken ryzokuken merged commit 76d2dab into main Oct 22, 2020
@ryzokuken ryzokuken deleted the 935-sub-minute-offsets branch October 22, 2020 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should time zone offsets be signed Durations?
2 participants