diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 4f03f1921..60f268b69 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -66,7 +66,7 @@ export const getCalcValue = (column: IAVColumn) => { export const genCellValue = (colType: TAVCol, value: string | { content: string, color: string -}[] | { content?: number, content2?: number, hasEndDate?: boolean }) => { +}[] | IAVCellDateValue) => { let cellValue: IAVCellValue; if (typeof value === "string") { if (colType === "number") { @@ -106,7 +106,9 @@ export const genCellValue = (colType: TAVCol, value: string | { type: colType, date: { content: null, + isNotEmpty: false, content2: null, + isNotEmpty2: false, hasEndDate: false, } }; @@ -123,7 +125,7 @@ export const genCellValue = (colType: TAVCol, value: string | { } else if (colType === "date") { cellValue = { type: colType, - date: value as { content?: number, content2?: number, hasEndDate?: boolean } + date: value as IAVCellDateValue }; } } diff --git a/app/src/protyle/render/av/date.ts b/app/src/protyle/render/av/date.ts index 79107e21a..a36ef6c3d 100644 --- a/app/src/protyle/render/av/date.ts +++ b/app/src/protyle/render/av/date.ts @@ -3,7 +3,7 @@ import * as dayjs from "dayjs"; export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => { let hasEndDate = true; - let cellValue:IAVCell; + let cellValue: IAVCell; cellElements.forEach((cellElement) => { data.rows.find(row => { if (cellElement.parentElement.dataset.id === row.id) { @@ -24,11 +24,11 @@ export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => { hasEndDate = false; } let value = ""; - if (cellValue?.value?.date?.content) { + if (cellValue?.value?.date?.isNotEmpty) { value = dayjs(cellValue.value.date.content).format("YYYY-MM-DDTHH:mm"); } let value2 = ""; - if (cellValue?.value?.date?.content2) { + if (cellValue?.value?.date?.isNotEmpty2) { value2 = dayjs(cellValue.value.date.content2).format("YYYY-MM-DDTHH:mm"); } return `