Skip to content

Commit

Permalink
fix: ensure date-time is ISO format
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Nov 28, 2023
1 parent 976a23c commit d92a783
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 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-02 00:00:00',
submittedAt: '2023-10-02T00:00:00.000Z',
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-02 00:00:00',
submittedAt: '2023-10-02T00:00:00.000Z',
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-02 00:00:00',
submittedAt: '2023-10-02T00:00:00.000Z',
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-02 00:00:00',
submittedAt: '2023-10-02T00:00:00.000Z',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json',
},
Expand Down
2 changes: 2 additions & 0 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,9 @@
"type": "string"
},
"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$",
"type": "string"
},
"Email": {
Expand Down
2 changes: 2 additions & 0 deletions types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ 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$
* @description Regex-based implementation of iso-date-time until available in [email protected]
*/
export type DateTime = string;

Expand Down

0 comments on commit d92a783

Please sign in to comment.