export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => { const colId = cellElements[0].dataset["colId"]; const colData = data.columns.find(item => { if (item.id === colId) { return item; } }); let hasEndDate = true let hasMatch = false cellElements.forEach((cellElement) => { data.rows.find(row => { if (cellElement.parentElement.dataset.id === row.id) { row.cells.find(cell => { if (cell.id === cellElement.dataset.id) { if (!cell.value || !cell.value.date || !cell.value.date.content2) { hasEndDate = false hasMatch = true } return true; } }); return true; } }); }); if (!hasMatch) { hasEndDate = false } return `