fix: handle MM/dd/yyyy HH:mm:ss date format from NordPool API#111
Merged
sondresjolyst merged 1 commit intodevelopmentfrom Apr 21, 2026
Merged
fix: handle MM/dd/yyyy HH:mm:ss date format from NordPool API#111sondresjolyst merged 1 commit intodevelopmentfrom
sondresjolyst merged 1 commit intodevelopmentfrom
Conversation
NordPool started returning delivery dates in 'MM/dd/yyyy HH:mm:ss' format instead of ISO 8601, causing a FormatException in ParseDeliveryDate. Added ParseDeliveryDate() helper (aligned with the main-branch timezone fix) that handles all three formats NordPool may return: - ISO with T (e.g. 2026-04-18T22:00:00Z) - parsed as UTC via DateTimeOffset - MM/dd/yyyy HH:mm:ss (new NordPool format) - stored as UTC midnight - yyyy-MM-dd (date-only) - stored as UTC midnight This prevents both the FormatException and timezone-dependent duplicate rows, and fixes both the background fetch job and the controller endpoint.
c9b00b8 to
7218d5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NordPool started returning delivery dates in MM/dd/yyyy HH:mm:ss format instead of ISO 8601, causing a FormatException that crashed both the daily background fetch job and the electricity prices endpoint. Added ParseDeliveryDate() helper that handles all three formats NordPool may return, and brings in the same timezone-safe UTC midnight storage from main to prevent duplicate rows.