File size: 256 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 |
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 );
}
|