Function
dateToString
(date: Date, withTimezone?: boolean)
Source from the content-addressed store, hash-verified
| 32 | } |
| 33 | |
| 34 | function dateToString(date: Date, withTimezone?: boolean) { |
| 35 | if (withTimezone) { |
| 36 | return date.toISOString(); |
| 37 | } |
| 38 | const tzOffset = date.getTimezoneOffset() * 6_000; |
| 39 | return new Date(date.valueOf() - tzOffset).toISOString().slice(0, -1); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Because of typescript's peculiar handling of Inifinity/-Infinity, ranges without limit need to |
Tested by
no test coverage detected