Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/15662

Vanessa1e5f514225ca
diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.ts
index 6608df69ac..7499649cf9 100644
--- a/app/src/protyle/render/av/blockAttr.ts
+++ b/app/src/protyle/render/av/blockAttr.ts
@@ -20,6 +20,7 @@ import {getCompressURL} from "../../../util/image";
const genAVRollupHTML = (value: IAVCellValue) => {
let html = "";
+ const dataValue: IAVCellDateValue = value[value.type as "date"];
switch (value.type) {
case "block":
if (value?.isDetached) {
@@ -37,11 +38,15 @@ const genAVRollupHTML = (value: IAVCellValue) => {
case "date":
case "updated":
case "created":
- if (value[value.type] && value[value.type].isNotEmpty) {
- html = dayjs(value[value.type].content).format(value[value.type].isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
- }
- if (value[value.type] && value[value.type].hasEndDate && value[value.type].isNotEmpty && value[value.type].isNotEmpty2) {
- html += `<svg class="av__cellicon"><use xlink:href="#iconForward"></use></svg>${dayjs(value[value.type].content2).format(value[value.type].isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm")}`;
+ if (dataValue.formattedContent) {
+ html = dataValue.formattedContent;
+ } else {
+ if (dataValue && dataValue.isNotEmpty) {
+ html = dayjs(dataValue.content).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
+ }
+ if (dataValue && dataValue.hasEndDate && dataValue.isNotEmpty && dataValue.isNotEmpty2) {
+ html = `<svg class="av__cellicon"><use xlink:href="#iconForward"></use></svg>${dayjs(dataValue.content2).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm")}`;
+ }
}
if (html) {
html = `<span class="av__celltext">${html}</span>`;
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 70e430f59e..7db7628d29 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -1040,13 +1040,7 @@ const renderRollup = (cellValue: IAVCellValue) => {
} else if (cellValue.type === "number") {
text = cellValue?.number.formattedContent || cellValue?.number.content.toString() || "";
} else if (["date", "updated", "created"].includes(cellValue.type)) {
- let dataValue = cellValue ? cellValue.date : null;
- if (!dataValue) {
- dataValue = cellValue.updated;
- }
- if (!dataValue) {
- dataValue = cellValue.created;
- }
+ const dataValue = cellValue ? cellValue[cellValue.type as "date"] : null;
if (dataValue.formattedContent) {
text = dataValue.formattedContent;
} else {