An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Validate flashcard due date input
Daniel8fa8f45e242c
diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.tsindex 37d1c2482d..931c5069d3 100644--- a/app/src/card/openCard.ts+++ b/app/src/card/openCard.ts@@ -395,10 +395,25 @@ export const bindCardEvent = async (options: {min: "1",step: "1",onConfirm: (value, timedialog) => {+ const inputElement = timedialog.element.querySelector("input") as HTMLInputElement;+ const days = Number(value);+ if (!Number.isInteger(days) || days < 1) {+ showMessage(window.siyuan.languages.invalid, 3000, "error");+ inputElement.focus();+ inputElement.select();+ return;+ }+ const due = dayjs().add(days, "day");+ if (!due.isValid() || due.year() > 9999) {+ showMessage(window.siyuan.languages.invalid, 3000, "error");+ inputElement.focus();+ inputElement.select();+ return;+ }fetchPost("/api/riff/batchSetRiffCardsDueTime", {cardDues: [{id: currentCard.cardID,- due: dayjs().add(parseInt(value), "day").format("YYYYMMDDHHmmss")+ due: due.format("YYYYMMDDHHmmss")}]}, () => {actionElements[0].classList.add("fn__none");