瀏覽代碼

fix: return local date from `getFormattedDate`

Craig Quiter 2 月之前
父節點
當前提交
0dae8ded13
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/lib/utils/index.ts

+ 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
 // Get the date in the format YYYY-MM-DD
 export const getFormattedDate = () => {
 export const getFormattedDate = () => {
 	const date = new Date();
 	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
 // Get the time in the format HH:MM:SS