(d: Date)
| 56 | } |
| 57 | |
| 58 | export function formatDateTimeWithSpaces(d: Date) { |
| 59 | const t = (x: string) => x.slice(-2); |
| 60 | // Hopefully some day we can use the temporal api to make this less of a pain |
| 61 | return ( |
| 62 | `${d.getFullYear()} ${t('0' + (d.getMonth() + 1))} ${t('0' + d.getDate())}` + |
| 63 | `${t('0' + d.getHours())} ${t('0' + d.getMinutes())} ${t('0' + d.getSeconds())}` |
| 64 | ); |
| 65 | } |
| 66 | |
| 67 | export function formatISODate(dt: Date, full = false) { |
| 68 | const month = '' + (dt.getUTCMonth() + 1); |