From dce30d272f2605e6170ac96675fb9e62a48c0492 Mon Sep 17 00:00:00 2001 From: "Marinkov, Magdalena" Date: Mon, 12 Aug 2024 16:20:07 +0200 Subject: [PATCH] Revert "feat(COOP-2237): add new validator to check for minDate" This reverts commit ab26bdb88cea054492c32516a754b17c547a4234. --- packages/validators/src/date.validators.ts | 24 ---------------------- 1 file changed, 24 deletions(-) diff --git a/packages/validators/src/date.validators.ts b/packages/validators/src/date.validators.ts index f2e8637..4fc3e10 100644 --- a/packages/validators/src/date.validators.ts +++ b/packages/validators/src/date.validators.ts @@ -69,27 +69,3 @@ export function isDate(): BalValidatorFn { return DateFns.isDate(value) } } - -/** - * Returns `true` if the given data is at the same or after the value date - * - * ```typescript - * BalValidators.isMinDate('2000-01-01')('2000-01-01') // true - * BalValidators.isMinDate('2000-01-02')('2000-01-01') // true - * BalValidators.isMinDate(new Date(2020, 0, 1))(new Date(2020, 0, 1)) // true - * ``` - */ -export function isMinDate(date: Date | string): BalValidatorFn { - return function (value: any) { - if (BalUtils.isEmpty(value)) { - return true - } - if (isString(value)) { - value = BalUtils.parse(value) - } - if (isString(date)) { - date = BalUtils.parse(date) - } - return DateFns.isSameDay(value, date) || DateFns.isAfter(value, date) - } -}