diff --git a/examples/data/ldcE.ts b/examples/data/ldcE.ts index 20319dde..6d661ccd 100644 --- a/examples/data/ldcE.ts +++ b/examples/data/ldcE.ts @@ -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:00z', schema: 'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json', }, diff --git a/examples/data/ldcP.ts b/examples/data/ldcP.ts index 500b8f76..47fdac6b 100644 --- a/examples/data/ldcP.ts +++ b/examples/data/ldcP.ts @@ -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+01:00', schema: 'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json', }, diff --git a/examples/data/planningPermission.ts b/examples/data/planningPermission.ts index 46c73920..20c0c1b1 100644 --- a/examples/data/planningPermission.ts +++ b/examples/data/planningPermission.ts @@ -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.00Z', schema: 'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json', }, diff --git a/examples/data/priorApproval.ts b/examples/data/priorApproval.ts index 406b6632..9254a72a 100644 --- a/examples/data/priorApproval.ts +++ b/examples/data/priorApproval.ts @@ -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:00Z', schema: 'https://theopensystemslab.github.io/digital-planning-data-schemas/@next/schema.json', }, diff --git a/schema/schema.json b/schema/schema.json index 5896dcb4..b2fa8876 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1227,7 +1227,9 @@ "type": "string" }, "DateTime": { + "description": "Regex-based implementation of iso-date-time until available in ajv-formats@3.0.0", "format": "date-time", + "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": { diff --git a/types/utils.ts b/types/utils.ts index 07574b8a..946b0443 100644 --- a/types/utils.ts +++ b/types/utils.ts @@ -18,6 +18,8 @@ export type URL = string; /** * @format date-time + * @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 ajv-formats@3.0.0 */ export type DateTime = string;