mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
9d4ed40acd
commit
1e5f514225
2 changed files with 11 additions and 12 deletions
|
@ -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>`;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue