Skip to content

Conversation

Copy link

Copilot AI commented Dec 27, 2025

The test for year padding in test-format.ts was failing because new Date(Date.UTC(12, 5, 7, 12, 0, 0)) creates a date in year 1912, not year 12.

Changes

  • Updated test to use ISO date string format: new Date("0012-06-07T12:00:00Z")
  • This properly creates a date in year 12 to verify that Format.date() correctly pads years below 1000 to four digits

The test now correctly validates the yyyyMMdd format requirement for edge cases.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix FinTS date formatting to use four-digit year Fix date constructor in year padding test Dec 27, 2025
Copilot AI requested a review from larsdecker December 27, 2025 02:58
@larsdecker larsdecker marked this pull request as ready for review December 27, 2025 16:00
Copilot AI review requested due to automatic review settings December 27, 2025 16:00
@larsdecker larsdecker merged commit 47f2690 into codex/update-date-formatting-to-yyyymmdd Dec 27, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a failing test in the date formatting module. The original test intended to verify that Format.date() correctly pads years below 1000 to four digits, but it was inadvertently testing year 1912 instead of year 12 due to incorrect use of the Date.UTC() constructor.

Key Changes:

  • Fixed the date constructor in the year padding test to use ISO string format instead of Date.UTC(), ensuring the test validates year 12 as intended
  • Updated yarn.lock with various dependency changes (appears unrelated to the test fix)

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
packages/fints/src/tests/test-format.ts Corrected date constructor to properly create a date in year 12 using ISO string format
yarn.lock Contains multiple dependency changes including replacement of @types/winston with @types/yamljs and version string consolidations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants