| ... | @@ -394,7 +394,9 @@ function addSnoozeDays(base: Date, days: number): Date { | ... | @@ -394,7 +394,9 @@ function addSnoozeDays(base: Date, days: number): Date { |
| 394 | /** | 394 | /** |
| 395 | * Shared "snooze until" choices for every client. "This evening" only | 395 | * Shared "snooze until" choices for every client. "This evening" only |
| 396 | * appears while it is meaningfully before evening; after that the calendar | 396 | * appears while it is meaningfully before evening; after that the calendar |
| 397 | * choices start at "Tomorrow". | 397 | * choices start at "Tomorrow". Calendar presets that land on the same |
| | 398 | * instant collapse: on Sundays "Tomorrow" and "Next week" are both Monday |
| | 399 | * morning, so only "Tomorrow" is offered. |
| 398 | */ | 400 | */ |
| 399 | export function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset> { | 401 | export function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset> { |
| 400 | const inAnHour = new Date(now.getTime() + HOUR_MS); | 402 | const inAnHour = new Date(now.getTime() + HOUR_MS); |
| ... | @@ -434,12 +436,14 @@ export function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset> { | ... | @@ -434,12 +436,14 @@ export function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset> { |
| 434 | | 436 | |
| 435 | const daysUntilMonday = (1 - now.getDay() + 7) % 7 || 7; | 437 | const daysUntilMonday = (1 - now.getDay() + 7) % 7 || 7; |
| 436 | const nextWeek = snoozeAtHour(addSnoozeDays(now, daysUntilMonday), MORNING_HOUR); | 438 | const nextWeek = snoozeAtHour(addSnoozeDays(now, daysUntilMonday), MORNING_HOUR); |
| 437 | presets.push({ | 439 | if (nextWeek.getTime() !== tomorrow.getTime()) { |
| 438 | id: "next-week", | 440 | presets.push({ |
| 439 | label: "Next week", | 441 | id: "next-week", |
| 440 | whenLabel: `${nextWeek.toLocaleDateString(undefined, { weekday: "short" })} ${snoozeTimeOfDayLabel(nextWeek)}`, | 442 | label: "Next week", |
| 441 | snoozedUntil: nextWeek.toISOString(), | 443 | whenLabel: `${nextWeek.toLocaleDateString(undefined, { weekday: "short" })} ${snoozeTimeOfDayLabel(nextWeek)}`, |
| 442 | }); | 444 | snoozedUntil: nextWeek.toISOString(), |
| | 445 | }); |
| | 446 | } |
| 443 | | 447 | |
| 444 | return presets; | 448 | return presets; |
| 445 | } | 449 | } |