From 00f87b1e6ea0f97af2b969046a6d40334da19f45 Mon Sep 17 00:00:00 2001 From: OgunyemiO Date: Tue, 20 Aug 2024 18:19:34 +0100 Subject: [PATCH] dateTimeValidator changes --- src/noc/containers/noc-field/utils/noc-validators.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/noc/containers/noc-field/utils/noc-validators.ts b/src/noc/containers/noc-field/utils/noc-validators.ts index 70786ad479..3630db1ba5 100644 --- a/src/noc/containers/noc-field/utils/noc-validators.ts +++ b/src/noc/containers/noc-field/utils/noc-validators.ts @@ -63,10 +63,11 @@ export class NocValidators { return null; } const value = control.value.toString(); + console.log(value) const [year, month, day] = value.split('-').map(Number); const isValidDate = moment(value, 'YYYY-MM-DD', true).isValid(); if (!isValidDate || year === 0 || month === 0 || month > 12 || day === 0 || day > 31) { - return { month: true, date: true, valid: false }; + return { date: true, month: true, year: true, valid: false }; } return null; };