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

Improve test coverage for balancing up to weeks (when year/month) #2813

Open
arshaw opened this issue Mar 31, 2024 · 0 comments
Open

Improve test coverage for balancing up to weeks (when year/month) #2813

arshaw opened this issue Mar 31, 2024 · 0 comments

Comments

@arshaw
Copy link
Contributor

arshaw commented Mar 31, 2024

I noticed fullcalendar's temporal-polyfill has an incorrect implementation of balancing days and smaller up to weeks when years or months are present. It was not getting caught by test262 tests. We should improve test coverage for this.

Temporal.Duration.from({ months: 1, days: 1 })
  .round({
    relativeTo: '2024-01-01',
    smallestUnit: 'weeks',
    roundingIncrement: 99,
    roundingMode: 'ceil'
  })
  .toString()

// temporal-polyfill: P2M (wrong)
// reference impl:    P1M99W (correct)

Things work fine in the reference implementation.

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

No branches or pull requests

1 participant