(date: Date)
| 68 | } |
| 69 | |
| 70 | export function formatDate(date: Date): string { |
| 71 | const locale = 'en-US'; // fixed locale to ensure consistency across local defaults execution |
| 72 | return date |
| 73 | .toLocaleString(locale, { |
| 74 | weekday: 'short', |
| 75 | month: 'short', |
| 76 | day: 'numeric', |
| 77 | year: 'numeric', |
| 78 | hour: 'numeric', |
| 79 | minute: '2-digit', |
| 80 | timeZoneName: 'short', |
| 81 | }) |
| 82 | .replace(/\u202F/g, ' '); // see https://github.com/nodejs/node/issues/45171 |
| 83 | } |
| 84 | |
| 85 | export function truncateText( |
| 86 | text: string, |
no outgoing calls
no test coverage detected