Download wp-calypso/client/dashboard/utils/datetime.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 256 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/utils/datetime.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/utils/datetime.ts
-
curl -L -o datetime.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/utils/datetime.ts
256 Bytes
| export function formatDate( | |
| date: Date, | |
| locale: string, | |
| formatOptions: Intl.DateTimeFormatOptions = { dateStyle: 'medium' } | |
| ) { | |
| if ( isNaN( date.getTime() ) ) { | |
| return ''; | |
| } | |
| return new Intl.DateTimeFormat( locale, formatOptions ).format( date ); | |
| } | |