Skip to content

Fix ParseDate to handle non-strict ISO 8601 date formats from connectors#3048

Open
EricBuist wants to merge 2 commits intomicrosoft:mainfrom
EricBuist:users/ericbuist/datetime-parsing-fix
Open

Fix ParseDate to handle non-strict ISO 8601 date formats from connectors#3048
EricBuist wants to merge 2 commits intomicrosoft:mainfrom
EricBuist:users/ericbuist/datetime-parsing-fix

Conversation

@EricBuist
Copy link
Copy Markdown
Contributor

ParseDate used element.GetDateTime() which only accepts strict ISO 8601. Connector APIs like Jira return valid dates with timezone offsets without colons (e.g. "+0000" instead of "+00:00") that GetDateTime() rejects. Now falls back to DateTimeOffset.TryParse on FormatException, and returns an ErrorValue instead of throwing if both parsers fail.

ParseDate used element.GetDateTime() which only accepts strict ISO 8601.
Connector APIs like Jira return valid dates with timezone offsets without
colons (e.g. "+0000" instead of "+00:00") that GetDateTime() rejects.
Now falls back to DateTimeOffset.TryParse on FormatException, and returns
an ErrorValue instead of throwing if both parsers fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@EricBuist EricBuist requested a review from a team as a code owner April 2, 2026 18:03
@EricBuist
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 3048 in repo microsoft/Power-Fx

…avior

Align DateTimeOffset.TryParse fallback with SwaggerTypeFormatExtensions'
ConvertToDate/ConvertToDatetime, which use DateTimeStyles.AssumeUniversal
so that date strings without timezone info are treated as UTC.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant