( now: Date, timeZone: string, )
| 80 | } |
| 81 | |
| 82 | export function getZonedDayBounds( |
| 83 | now: Date, |
| 84 | timeZone: string, |
| 85 | ): { startsAt: Date; resetsAt: Date } { |
| 86 | const nowParts = getZonedParts(now, timeZone) |
| 87 | const today = { |
| 88 | year: nowParts.year, |
| 89 | month: nowParts.month, |
| 90 | day: nowParts.day, |
| 91 | } |
| 92 | const tomorrow = addDaysToYmd(today.year, today.month, today.day, 1) |
| 93 | |
| 94 | return { |
| 95 | startsAt: getUtcForZonedTime(today, timeZone, 0, 0), |
| 96 | resetsAt: getUtcForZonedTime(tomorrow, timeZone, 0, 0), |
| 97 | } |
| 98 | } |
no test coverage detected