* 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)
| 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. |