update
This commit is contained in:
@@ -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}日`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user