Vanessa 2025-11-10 20:11:20 +08:00
parent 67231dbf6a
commit a6d3093cfc
2 changed files with 7 additions and 3 deletions

View file

@ -980,7 +980,7 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0, showIcon = tru
const dataValue = cellValue ? cellValue[cellValue.type as "date"] : null;
text = `<span class="av__celltext" data-value='${JSON.stringify(dataValue)}'>`;
if (dataValue && dataValue.isNotEmpty) {
text += dayjs(dataValue.content).format("YYYY-MM-DD HH:mm");
text += dataValue.formattedContent;
}
text += "</span>";
} else if (["lineNumber"].includes(cellValue.type)) {

View file

@ -193,7 +193,7 @@ export const getEditHTML = (options: {
<label class="b3-menu__item">
<span class="fn__flex-center">${window.siyuan.languages.includeTime}</span>
<span class="fn__space fn__flex-1"></span>
<input data-type="includeTime" type="checkbox" class="b3-switch b3-switch--menu" ${colData[colData.type as "updated"]?.includeTime ? "checked" : ""}>
<input data-type="includeTime" type="checkbox" class="b3-switch b3-switch--menu" ${(!colData[colData.type as "updated"] || colData[colData.type as "updated"].includeTime) ? "checked" : ""}>
</label>`;
}
html += `<button class="b3-menu__separator" data-id="separator_3"></button>
@ -386,7 +386,11 @@ export const bindEditEvent = (options: {
avID,
data: !includeTimeElement.checked,
}]);
colData[colData.type as "updated"].includeTime = includeTimeElement.checked;
if (colData[colData.type as "updated"]) {
colData[colData.type as "updated"].includeTime = includeTimeElement.checked;
} else {
colData[colData.type as "updated"] = {includeTime: includeTimeElement.checked};
}
});
}