浏览代码

Merge pull request #10076 from crizCraig/local_date

fix: return local date from `getFormattedDate`
Timothy Jaeryang Baek 2 月之前
父节点
当前提交
b0ad5cd863
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 1 2
      backend/open_webui/retrieval/web/utils.py
  2. 4 1
      src/lib/utils/index.ts

+ 1 - 2
backend/open_webui/retrieval/web/utils.py

@@ -135,7 +135,6 @@ class SafeWebBaseLoader(WebBaseLoader):
         results = await self.fetch_all(urls)
         return self._unpack_fetch_results(results, urls, parser=parser)
 
-
     def lazy_load(self) -> Iterator[Document]:
         """Lazy load text from the url(s) in web_path with error handling."""
         for path in self.web_paths:
@@ -194,5 +193,5 @@ def get_web_loader(
         verify_ssl=verify_ssl,
         requests_per_second=requests_per_second,
         continue_on_failure=True,
-        trust_env=trust_env
+        trust_env=trust_env,
     )

+ 4 - 1
src/lib/utils/index.ts

@@ -1000,7 +1000,10 @@ export const bestMatchingLanguage = (supportedLanguages, preferredLanguages, def
 // Get the date in the format YYYY-MM-DD
 export const getFormattedDate = () => {
 	const date = new Date();
-	return date.toISOString().split('T')[0];
+	const year = date.getFullYear();
+	const month = String(date.getMonth() + 1).padStart(2, '0');
+	const day = String(date.getDate()).padStart(2, '0');
+	return `${year}-${month}-${day}`;
 };
 
 // Get the time in the format HH:MM:SS