Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cdk): redundant assert log if hours are greater than 23 #8449

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion projects/cdk/date-time/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading