Download src/utils/formatDate.ts from nolual/majic: direct link, hf CLI and curl.
- Browser
- Download file 371 Bytes
-
https://huggingface.co/nolual/majic/resolve/main/src/utils/formatDate.ts
- Command line
-
hf download hf://nolual/majic/src/utils/formatDate.ts
-
curl -L -o formatDate.ts https://huggingface.co/nolual/majic/resolve/main/src/utils/formatDate.ts
371 Bytes
| export function formatDate(inputDate: string): string { | |
| const date = new Date(inputDate); | |
| const options: Intl.DateTimeFormatOptions = { | |
| year: "numeric", | |
| month: "long", | |
| day: "2-digit", | |
| hour: "numeric", | |
| minute: "numeric", | |
| timeZoneName: "short", | |
| }; | |
| const formattedDate = date.toLocaleDateString("en-US", options); | |
| return formattedDate; | |
| } | |