MCPcopy Create free account
hub / github.com/angular/components / compareTime

Function compareTime

src/material/core/datetime/date-adapter.ts:309–315  ·  view source on GitHub ↗

* Compares the time values of two dates. * @param first First date to compare. * @param second Second date to compare. * @returns 0 if the times are equal, a number less than 0 if the first time is earlier, * a number greater than 0 if the first time is later.

(first: D, second: D)

Source from the content-addressed store, hash-verified

307 * a number greater than 0 if the first time is later.
308 */
309 compareTime(first: D, second: D): number {
310 return (
311 this.getHours(first) - this.getHours(second) ||
312 this.getMinutes(first) - this.getMinutes(second) ||
313 this.getSeconds(first) - this.getSeconds(second)
314 );
315 }
316
317 /**
318 * Checks if two dates are equal.

Callers

nothing calls this directly

Calls 3

getHoursMethod · 0.45
getMinutesMethod · 0.45
getSecondsMethod · 0.45

Tested by

no test coverage detected