This commit is contained in:
2025-12-27 19:35:39 +08:00
parent 8121b74649
commit e2b1e21153
18 changed files with 470 additions and 96 deletions

View File

@@ -9,3 +9,16 @@ export function makeFirstCharUpper(str: string): string {
if (!str) return "";
return str.charAt(0).toUpperCase() + str.slice(1);
}
/**
* Formats a date string into a more readable format.
* @param dateString - The date string to format.
* @returns The formatted date string.
*/
export function formatDate(dateString: string): string {
const date = new Date(dateString);
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
return `${year}${month}${day}`;
}