Skip to content

Commit

Permalink
fix: support local time if no offset
Browse files Browse the repository at this point in the history
  • Loading branch information
bchrobot authored Jun 20, 2023
1 parent 5e23b4f commit 5078c8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ const datetimeRegex = (args: { precision: number | null; offset: boolean }) => {
);
} else {
return new RegExp(
`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`
`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z?$`
);
}
} else if (args.precision === 0) {
Expand All @@ -598,7 +598,7 @@ const datetimeRegex = (args: { precision: number | null; offset: boolean }) => {
);
} else {
return new RegExp(
`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`
`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z?$`
);
}
}
Expand Down

0 comments on commit 5078c8f

Please sign in to comment.