From 1e30ba15274a559fe25bbde7c38addee1d9e41d1 Mon Sep 17 00:00:00 2001 From: Maicol Battistini Date: Thu, 15 Jun 2023 15:21:29 +0200 Subject: [PATCH] fix: Model dates --- resources/ts/Models/Model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/ts/Models/Model.ts b/resources/ts/Models/Model.ts index d3384fd3a..5bf4de077 100644 --- a/resources/ts/Models/Model.ts +++ b/resources/ts/Models/Model.ts @@ -26,7 +26,7 @@ export default abstract class Model = { createdAt: 'YYYY-MM-DDTHH:mm:ss.ssssssZ', updatedAt: 'YYYY-MM-DDTHH:mm:ss.ssssssZ' }; @@ -62,6 +62,11 @@ export default abstract class Model; } + isDateAttribute(attributeName: string) { + // @ts-ignore + return super.isDateAttribute(attributeName) && this.attributes.get(attributeName) !== null; + } + getAttributes() { return super.getAttributes() as ModelAttributes; }