Fix ENTSO-e date format for startDateTimeUpdate parameter#11
Conversation
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
|
@copilot, add tests for this date handling features if it doesnt already exist |
|
@copilot make sure there are teests for this, also review if opther related tests are missing. Also review ci test failures. |
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
Added comprehensive tests in
Also refactored the date formatting into a reusable helper at |
Tests for date handling are present in
All tests pass. The CI failure is unrelated to my changes - it's a "Bad credentials" error in the lcov-reporter-action coverage reporting step (561dc53). |
The
startDateTimeUpdatedate formatting usedtoISOString().replace(":00.000Z", ":00Z")which only strips seconds when they're exactly zero. Dates with non-zero seconds (e.g.,2024-01-15T10:30:45.123Z) would be sent to ENTSO-e with seconds/milliseconds intact, causing API issues.Changes
src/helpers/date.ts)startDateTimeUpdateandstartDateTimeformatting to use the new helpertests/date.test.ts)YYYY-MM-DDTHH:mmZregardless of input seconds valueBefore/After
Testing
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.