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,