fix(formatted date): show month and date with two digits
This commit is contained in:
parent
919e8fd3eb
commit
af931b764c
@ -1,4 +1,6 @@
|
||||
export function useFormattedDate(_date: string) {
|
||||
const date = new Date(_date)
|
||||
return `${date.getUTCFullYear()}/${date.getUTCMonth()}/${date.getUTCDate()}`
|
||||
const date = new Date(_date);
|
||||
const month = date.getUTCMonth().toString().padStart(2, "0");
|
||||
const monthDate = date.getUTCDate().toString().padStart(2, "0");
|
||||
return `${date.getUTCFullYear()}/${month}/${monthDate}`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user