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

Function sameDate

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

* Checks if two dates are equal. * @param first The first date to check. * @param second The second date to check. * @returns Whether 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

322 * Null dates are considered equal to other null dates.
323 */
324 sameDate(first: D | null, second: D | null): boolean {
325 if (first && second) {
326 let firstValid = this.isValid(first);
327 let secondValid = this.isValid(second);
328 if (firstValid && secondValid) {
329 return !this.compareDate(first, second);
330 }
331 return firstValid == secondValid;
332 }
333 return first == second;
334 }
335
336 /**
337 * Checks if the times of two dates are equal.

Callers

nothing calls this directly

Calls 2

compareDateMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected