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

Function sameTime

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

* Checks if the times of two dates are equal. * @param first The first date to check. * @param second The second date to check. * @returns Whether the times of the two dates are equal. * Null dates are considered equal to other null dates.

(first: D | null, second: D | null)

Source from the content-addressed store, hash-verified

341 * Null dates are considered equal to other null dates.
342 */
343 sameTime(first: D | null, second: D | null): boolean {
344 if (first && second) {
345 const firstValid = this.isValid(first);
346 const secondValid = this.isValid(second);
347 if (firstValid && secondValid) {
348 return !this.compareTime(first, second);
349 }
350 return firstValid == secondValid;
351 }
352 return first == second;
353 }
354
355 /**
356 * Clamp the given date between min and max dates.

Callers

nothing calls this directly

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected