From cf29afaa7422b54f21b3c7d44d8ea1067fe3459e Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 9 Mar 2025 17:27:55 +0800 Subject: [PATCH] fix: Standardize file creation timestamp to ISO string format Ensure consistent ISO string representation of file creation timestamps in both file utility and knowledge content upload --- src/main/utils/file.ts | 2 +- src/renderer/src/pages/knowledge/KnowledgeContent.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/utils/file.ts b/src/main/utils/file.ts index c8d3494516..3bc34183f9 100644 --- a/src/main/utils/file.ts +++ b/src/main/utils/file.ts @@ -45,7 +45,7 @@ export function getAllFiles(dirPath: string, arrayOfFiles: FileType[] = []): Fil count: 1, origin_name: name, type: fileType, - created_at: new Date() + created_at: new Date().toISOString() } arrayOfFiles.push(fileItem) diff --git a/src/renderer/src/pages/knowledge/KnowledgeContent.tsx b/src/renderer/src/pages/knowledge/KnowledgeContent.tsx index d4bce82d72..983c38b367 100644 --- a/src/renderer/src/pages/knowledge/KnowledgeContent.tsx +++ b/src/renderer/src/pages/knowledge/KnowledgeContent.tsx @@ -100,7 +100,7 @@ const KnowledgeContent: FC = ({ selectedBase }) => { count: 1, origin_name: file.name, type: file.type as FileTypes, - created_at: new Date() + created_at: new Date().toISOString() })) .filter(({ ext }) => fileTypes.includes(ext)) console.debug('[KnowledgeContent] Uploading files:', _files, files)