Merge pull request #10076 from crizCraig/local_date

fix: return local date from `getFormattedDate`
This commit is contained in:
Timothy Jaeryang Baek
2025-02-15 20:10:56 -08:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -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