An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: 数据库相对日期
Vanessa6c35f9f07b62
diff --git a/app/src/protyle/render/av/filter.ts b/app/src/protyle/render/av/filter.tsindex 5b2a9edf9c..54fe84d5ba 100644--- a/app/src/protyle/render/av/filter.ts+++ b/app/src/protyle/render/av/filter.ts@@ -87,13 +87,13 @@ export const setFilter = async (options: {unit: parseInt((directElements[0].parentElement.lastElementChild as HTMLSelectElement).value),direction: parseInt(directElements[0].value)};- }- if (typeElements[1].value === "custom") {- newFilter.relativeDate2 = {- count: parseInt((directElements[1].parentElement.querySelector(".b3-text-field") as HTMLInputElement).value || "1"),- unit: parseInt((directElements[1].parentElement.lastElementChild as HTMLSelectElement).value),- direction: parseInt(directElements[1].value)- };+ if (typeElements[1].value === "custom") {+ newFilter.relativeDate2 = {+ count: parseInt((directElements[1].parentElement.querySelector(".b3-text-field") as HTMLInputElement).value || "1"),+ unit: parseInt((directElements[1].parentElement.lastElementChild as HTMLSelectElement).value),+ direction: parseInt(directElements[1].value)+ };+ }} else {newFilter.value = genCellValue(filterType, {isNotEmpty2: textElements[1].value !== "",@@ -568,15 +568,15 @@ export const getFiltersHTML = (data: IAVTable) => {dateValue = `${window.siyuan.languages[["pastDate", "current", "nextDate"][filter.relativeDate.direction + 1]]}${filter.relativeDate.direction ? filter.relativeDate.count : ""}${window.siyuan.languages[["day", "week", "month", "year"][filter.relativeDate.unit]]}`;+ if (filter.relativeDate2) {+ dateValue2 = `${window.siyuan.languages[["pastDate", "current", "nextDate"][filter.relativeDate2.direction + 1]]}+ ${filter.relativeDate2.direction ? filter.relativeDate2.count : ""}+ ${window.siyuan.languages[["day", "week", "month", "year"][filter.relativeDate2.unit]]}`;+ }} else if (filter.value?.date?.content) {dateValue = dayjs(filter.value.date.content).format("YYYY-MM-DD");dateValue2 = dayjs(filter.value.date.content2).format("YYYY-MM-DD");}- if (filter.relativeDate2) {- dateValue2 = `${window.siyuan.languages[["pastDate", "current", "nextDate"][filter.relativeDate2.direction + 1]]}- ${filter.relativeDate2.direction ? filter.relativeDate2.count : ""}- ${window.siyuan.languages[["day", "week", "month", "year"][filter.relativeDate2.unit]]}`;- }if (filter.operator === "Is between") {filterValue = ` ${window.siyuan.languages.filterOperatorIsBetween} ${dateValue} ${dateValue2}`;