Skip to content

fix(json_schema): accept numeric time offsets in date-time format - #257

Merged
RobinPicard merged 1 commit into
dottxt-ai:mainfrom
pjdurden:fix/date-time-numeric-offset
Aug 5, 2026
Merged

RobinPicard merged 1 commit into
dottxt-ai:mainfrom
pjdurden:fix/date-time-numeric-offset

Conversation

@pjdurden

Copy link
Copy Markdown
Contributor

The date-time format regex only accepted a Z (UTC) suffix, so valid
RFC3339 timestamps with a numeric offset such as 2018-11-13T20:20:39+01:00
were rejected. Extend the offset to also match (+|-)HH:MM per RFC3339
section 5.6.

The offset remains optional, so previously-accepted offset-less strings
like 2021-01-01T00:00:00 still match; this is documented in a comment.

Closes #155

Copilot AI review requested due to automatic review settings June 21, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


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

@RobinPicard

Copy link
Copy Markdown
Contributor

Thanks for opening a PR. I merged your other PR touching at the same part of the code, so there's a conflict now. Could you resolve it please?

The `date-time` format regex only accepted a `Z` (UTC) suffix, so valid
RFC3339 timestamps with a numeric offset such as `2018-11-13T20:20:39+01:00`
were rejected. Extend the offset to also match `(+|-)HH:MM` per RFC3339
section 5.6.

The offset remains optional, so previously-accepted offset-less strings
like `2021-01-01T00:00:00` still match; this is documented in a comment.

Closes dottxt-ai#155
@pjdurden
pjdurden force-pushed the fix/date-time-numeric-offset branch from b245e59 to 51a010e Compare August 4, 2026 18:16
@pjdurden

pjdurden commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main. Kept your merged per-month DATE regex as-is, so this PR is now only the DATE_TIME offset change. Tests and fmt pass locally.

@RobinPicard RobinPicard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great, thanks!

@RobinPicard
RobinPicard merged commit 116a7c3 into dottxt-ai:main Aug 5, 2026
8 checks passed
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.

The regex for the date-time format does not lead to valid strings

3 participants