(date: Date)
| 10 | |
| 11 | // If useful elsewhere, helper funcs should move to core/util/index.ts or similar |
| 12 | function getOffsetDatetime(date: Date): Date { |
| 13 | const offset = date.getTimezoneOffset(); |
| 14 | const offsetHours = Math.floor(offset / 60); |
| 15 | const offsetMinutes = offset % 60; |
| 16 | date.setHours(date.getHours() - offsetHours); |
| 17 | date.setMinutes(date.getMinutes() - offsetMinutes); |
| 18 | |
| 19 | return date; |
| 20 | } |
| 21 | |
| 22 | function asBasicISOString(date: Date): string { |
| 23 | const isoString = date.toISOString(); |