Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/12091

Vanessa25169ce63632
diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts
index ae3560247e..ae6adbd93e 100644
--- a/app/src/protyle/render/av/col.ts
+++ b/app/src/protyle/render/av/col.ts
@@ -187,6 +187,13 @@ export const getEditHTML = (options: {
<span class="fn__flex-center">${window.siyuan.languages.fillSpecificTime}</span>
<span class="fn__space fn__flex-1"></span>
<input data-type="fillSpecificTime" type="checkbox" class="b3-switch b3-switch--menu" ${colData.date?.fillSpecificTime ? "checked" : ""}>
+</label>`;
+ } else if (["updated", "created"].includes(colData.type)) {
+ html += `<button class="b3-menu__separator" data-id="separator_2"></button>
+<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.date?.includeTime ? "checked" : ""}>
</label>`;
}
html += `<button class="b3-menu__separator" data-id="separator_3"></button>
@@ -365,6 +372,24 @@ export const bindEditEvent = (options: {
});
}
+ const includeTimeElement = options.menuElement.querySelector('.b3-switch[data-type="includeTime"]') as HTMLInputElement;
+ if (includeTimeElement) {
+ includeTimeElement.addEventListener("change", () => {
+ transaction(options.protyle, [{
+ action: "setAttrViewUpdatedIncludeTime",
+ id: colId,
+ avID,
+ data: includeTimeElement.checked,
+ }], [{
+ action: "setAttrViewUpdatedIncludeTime",
+ id: colId,
+ avID,
+ data: !includeTimeElement.checked,
+ }]);
+ colData.includeTime = includeTimeElement.checked;
+ });
+ }
+
const wrapElement = options.menuElement.querySelector('.b3-switch[data-type="wrap"]') as HTMLInputElement;
if (wrapElement) {
wrapElement.addEventListener("change", () => {