* Gets the date table cell element that is or contains the specified element. * Or returns null if element is not part of a date cell.
(element: HTMLElement)
| 632 | * Or returns null if element is not part of a date cell. |
| 633 | */ |
| 634 | function getCellElement(element: HTMLElement): HTMLElement | null { |
| 635 | let cell: HTMLElement | undefined; |
| 636 | if (isTableCell(element)) { |
| 637 | cell = element; |
| 638 | } else if (isTableCell(element.parentNode)) { |
| 639 | cell = element.parentNode as HTMLElement; |
| 640 | } else if (isTableCell(element.parentNode?.parentNode)) { |
| 641 | cell = element.parentNode!.parentNode as HTMLElement; |
| 642 | } |
| 643 | |
| 644 | return cell?.getAttribute('data-mat-row') != null ? cell : null; |
| 645 | } |
| 646 | |
| 647 | /** Checks whether a value is the start of a range. */ |
| 648 | function isStart(value: number, start: number | null, end: number | null): boolean { |
no test coverage detected