From 1abe66bdcd44f2b5f7ccfaf26e6f56bbd0ae5368 Mon Sep 17 00:00:00 2001 From: "a.beltsov" Date: Fri, 9 Aug 2024 15:59:03 +0300 Subject: [PATCH] fix(cdk): redundant assert log if hours are greater than 23 --- projects/cdk/date-time/time.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/cdk/date-time/time.ts b/projects/cdk/date-time/time.ts index 2332f7217814..5d7958412f5d 100644 --- a/projects/cdk/date-time/time.ts +++ b/projects/cdk/date-time/time.ts @@ -24,7 +24,16 @@ export class TuiTime implements TuiTimeLike { ) { ngDevMode && tuiAssert.assert( - TuiTime.isValidTime(hours, minutes, seconds, ms), + // Currently `TuiTime` could have hours more than 23 + // in order to not break current behaviour of `isValidTime` the logic is duplicated + Number.isInteger(hours) && + tuiInRange(hours, 0, Infinity) && + Number.isInteger(minutes) && + tuiInRange(minutes, 0, MINUTES_IN_HOUR) && + Number.isInteger(seconds) && + tuiInRange(seconds, 0, SECONDS_IN_MINUTE) && + Number.isInteger(ms) && + tuiInRange(ms, 0, 1000), 'Time must be real, but got:', hours, minutes,