Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(insertDateTime): unable to insert date/time via quick editor or shortcut
SiriusXT5f197107917c
diff --git a/apps/client/src/widgets/type_widgets/text/EditableText.tsx b/apps/client/src/widgets/type_widgets/text/EditableText.tsxindex 5e3d06a769..0106ae0c09 100644--- a/apps/client/src/widgets/type_widgets/text/EditableText.tsx+++ b/apps/client/src/widgets/type_widgets/text/EditableText.tsx@@ -98,6 +98,14 @@ export default function EditableText({ note, parentComponent, ntxId, noteContexteditorApi: editorApiRef.current,});},+ insertDateTimeToTextCommand() {+ if (!editorApiRef.current) return;+ const date = new Date();+ const customDateTimeFormat = options.get("customDateTimeFormat");+ const dateString = utils.formatDateTime(date, customDateTimeFormat);++ addTextToEditor(dateString);+ },// Include note functionality noteaddIncludeNoteToTextCommand() {if (!editorApiRef.current) return;@@ -197,14 +205,6 @@ export default function EditableText({ note, parentComponent, ntxId, noteContext});}- useTriliumEvent("insertDateTimeToText", ({ ntxId: eventNtxId }) => {- if (eventNtxId !== ntxId) return;- const date = new Date();- const customDateTimeFormat = options.get("customDateTimeFormat");- const dateString = utils.formatDateTime(date, customDateTimeFormat);-- addTextToEditor(dateString);- });useTriliumEvent("addTextToActiveEditor", ({ text }) => {if (!noteContext?.isActive()) return;addTextToEditor(text);