| 1 | /** Compose calendars exchange calendar days at UTC midnight, not local instants. */ |
| 2 | export function snoozeDateToPickerDate(date: Date): string { |
| 3 | return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())).toISOString(); |
| 4 | } |
| 5 | |
| 6 | export function applySnoozePickerDate(date: Date, selected: Date): Date { |
| 7 | const next = new Date(date); |
| 8 | next.setFullYear(selected.getUTCFullYear(), selected.getUTCMonth(), selected.getUTCDate()); |
| 9 | return next; |
| 10 | } |
| 11 | |
| 12 | export function applySnoozePickerTime(date: Date, selected: Date): Date { |
| 13 | const next = new Date(date); |
| 14 | next.setHours(selected.getHours(), selected.getMinutes(), 0, 0); |
| 15 | return next; |
| 16 | } |