| 1 | export function getFormattedDate( |
| 2 | date: string | number | Date, |
| 3 | options: Intl.DateTimeFormatOptions = {}, |
| 4 | locale: Intl.LocalesArgument = "en-GB", |
| 5 | ) { |
| 6 | const formatOptions: Intl.DateTimeFormatOptions = { |
| 7 | day: "numeric", |
| 8 | month: "long", |
| 9 | year: "numeric", |
| 10 | ...options, |
| 11 | }; |
| 12 | return new Date(date).toLocaleDateString(locale, formatOptions); |
| 13 | } |