From 20e47596d4a8c11a0df246977adb8f5e1acca978 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:37:56 +0100 Subject: [PATCH] v0.2.3: Timestamp filenames for chat history (YYYYMMDDHHmmss) Co-Authored-By: Claude Sonnet 4.6 --- main.js | 6 ++++-- manifest.json | 2 +- package.json | 2 +- src/ChatView.ts | 11 +++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 839de40..7c98cc4 100644 --- a/main.js +++ b/main.js @@ -776,9 +776,11 @@ ${content}`; const folder = this.plugin.settings.threadsFolder; await this.app.vault.createFolder(folder).catch(() => { }); - const date = new Date(thread.created).toISOString().slice(0, 10); + const d = new Date(thread.created); + const ts = d.getFullYear().toString() + String(d.getMonth() + 1).padStart(2, "0") + String(d.getDate()).padStart(2, "0") + String(d.getHours()).padStart(2, "0") + String(d.getMinutes()).padStart(2, "0") + String(d.getSeconds()).padStart(2, "0"); + const date = d.toISOString().slice(0, 10); const safeName = thread.title.replace(/[\\/:*?"<>|]/g, " ").slice(0, 60); - const fileName = `${folder}/${date} ${safeName}.md`; + const fileName = `${folder}/${ts} ${safeName}.md`; let content = `--- created: ${date} id: ${thread.id} diff --git a/manifest.json b/manifest.json index 4066a72..1685290 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "memex-chat", "name": "Memex Chat", - "version": "0.2.2", + "version": "0.2.3", "minAppVersion": "1.4.0", "description": "Chat with your Obsidian vault using Claude AI — semantic context retrieval, @ mentions, thread history.", "author": "Sven", diff --git a/package.json b/package.json index 88ceb22..e20cf2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "memex-chat", - "version": "0.2.2", + "version": "0.2.3", "description": "Obsidian plugin: Chat with your vault using Claude AI", "main": "main.js", "scripts": { diff --git a/src/ChatView.ts b/src/ChatView.ts index 4df19f4..172427e 100644 --- a/src/ChatView.ts +++ b/src/ChatView.ts @@ -904,9 +904,16 @@ export class ChatView extends ItemView { const folder = this.plugin.settings.threadsFolder; await this.app.vault.createFolder(folder).catch(() => {}); - const date = new Date(thread.created).toISOString().slice(0, 10); + const d = new Date(thread.created); + const ts = d.getFullYear().toString() + + String(d.getMonth() + 1).padStart(2, "0") + + String(d.getDate()).padStart(2, "0") + + String(d.getHours()).padStart(2, "0") + + String(d.getMinutes()).padStart(2, "0") + + String(d.getSeconds()).padStart(2, "0"); + const date = d.toISOString().slice(0, 10); const safeName = thread.title.replace(/[\\/:*?"<>|]/g, " ").slice(0, 60); - const fileName = `${folder}/${date} ${safeName}.md`; + const fileName = `${folder}/${ts} ${safeName}.md`; let content = `---\ncreated: ${date}\nid: ${thread.id}\ntags: [chat]\n---\n\n# ${thread.title}\n\n`; for (const msg of thread.messages) {