Skip to content

Commit

Permalink
update regex to account for timezone offsets and optional miliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Nov 28, 2023
1 parent d92a783 commit 65652d8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/data/ldcE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ export const validLDCE: Schema = {
flowId: '824628b2-deeb-48b0-92b1-2ca7f3b17163',
url: 'https://www.editor.planx.dev/buckinghamshire/apply-for-a-lawful-development-certificate/preview',
},
submittedAt: '2023-10-02T00:00:00.000Z',
submittedAt: '2023-10-02t00:00:00z',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json',
},
Expand Down
2 changes: 1 addition & 1 deletion examples/data/ldcP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ export const validLDCP: Schema = {
flowId: '824628b2-deeb-48b0-92b1-2ca7f3b17163',
url: 'https://www.editor.planx.dev/buckinghamshire/apply-for-a-lawful-development-certificate/preview',
},
submittedAt: '2023-10-02T00:00:00.000Z',
submittedAt: '2023-10-02T00:00:00+01:00',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json',
},
Expand Down
2 changes: 1 addition & 1 deletion examples/data/planningPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ export const validPlanningPermission: Schema = {
flowId: '01e38c5d-e701-4e44-acdc-4d6b5cc3b854',
url: 'https://www.editor.planx.dev/lambeth/apply-for-planning-permission/preview',
},
submittedAt: '2023-10-02T00:00:00.000Z',
submittedAt: '2023-10-02T00:00:00.00Z',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json',
},
Expand Down
2 changes: 1 addition & 1 deletion examples/data/priorApproval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ export const validPriorApproval: Schema = {
flowId: 'c6628103-c648-4663-81e1-bfa0a1a18340',
url: 'https://www.editor.planx.dev/southwark/apply-for-prior-approval/preview',
},
submittedAt: '2023-10-02T00:00:00.000Z',
submittedAt: '2023-10-02T00:00:00Z',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json',
},
Expand Down
2 changes: 1 addition & 1 deletion schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@
"DateTime": {
"description": "Regex-based implementation of iso-date-time until available in [email protected]",
"format": "date-time",
"pattern": "^[0-9]{4}-((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(0[469]|11)-(0[1-9]|[12][0-9]|30)|(02)-(0[1-9]|[12][0-9]))T(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9]):(0[0-9]|[1-5][0-9])\\.[0-9]{3}Z$",
"pattern": "^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$",
"type": "string"
},
"Email": {
Expand Down
2 changes: 1 addition & 1 deletion types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type URL = string;

/**
* @format date-time
* @pattern ^[0-9]{4}-((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(0[469]|11)-(0[1-9]|[12][0-9]|30)|(02)-(0[1-9]|[12][0-9]))T(0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9]):(0[0-9]|[1-5][0-9])\.[0-9]{3}Z$
* @pattern ^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([Zz])|([\+|\-]([01][0-9]|2[0-3]):[0-5][0-9]))$
* @description Regex-based implementation of iso-date-time until available in [email protected]
*/
export type DateTime = string;
Expand Down

0 comments on commit 65652d8

Please sign in to comment.