Skip to content

Commit e6331d6

Browse files
fix(ScheduledMessages): label the next-Monday preset with its weekday
On a Monday the next-Monday preset is more than seven days from the start of today, so the calendar format fell through to sameElse and rendered "Mon, 9 Nov at 09:00" instead of "Monday at 09:00". Presets now use a timestamp/SchedulePreset key whose sameElse matches nextWeek, added to all 12 locales with each locale's own weekday format. Refs: REACT-1387
1 parent 0f9ce9a commit e6331d6

14 files changed

Lines changed: 24 additions & 1 deletion

File tree

โ€Žsrc/components/ScheduledMessages/ScheduleMessagePresetButton.tsxโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const ScheduleMessagePresetButton = ({
1919
Icon={IconClock}
2020
onClick={selectPreset}
2121
>
22-
{t('timestamp/ScheduledMessage', { timestamp: scheduledAt })}
22+
{t('timestamp/SchedulePreset', { timestamp: scheduledAt })}
2323
</ContextMenuButton>
2424
);
2525
};

โ€Žsrc/components/ScheduledMessages/__tests__/ScheduleMessageButton.test.tsxโ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
const user = generateUser({ id: 'user-id' });
2626

2727
const WEDNESDAY_MORNING = new Date(2026, 9, 28, 10, 30);
28+
const MONDAY_MORNING = new Date(2026, 10, 2, 13, 0);
2829

2930
const channelDataWith = (ownCapabilities: string[]) =>
3031
generateChannel({
@@ -188,6 +189,16 @@ describe('ScheduleMessageButton', () => {
188189
);
189190
});
190191

192+
it('labels the next-Monday preset with the weekday on a Monday', async () => {
193+
vi.setSystemTime(MONDAY_MORNING);
194+
await renderComposer();
195+
196+
await openMenu();
197+
198+
expect(screen.getByText('Tomorrow at 09:00')).toBeInTheDocument();
199+
expect(screen.getByText('Monday at 09:00')).toBeInTheDocument();
200+
});
201+
191202
it('schedules at the picked preset and confirms with the server time', async () => {
192203
const { channel, client } = await renderComposer();
193204
const serverScheduledAt = new Date(2026, 9, 29, 9, 0);

โ€Žsrc/i18n/de.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@
673673
"timestamp/relativeWeeksAgo": "vor {{ count }} Wo.",
674674
"timestamp/relativeYesterday": "Gestern",
675675
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Heute] [um] HH:mm\", \"nextDay\": \"[Morgen] [um] HH:mm\", \"lastDay\": \"[Gestern] [um] HH:mm\", \"nextWeek\": \"dddd [um] HH:mm\", \"lastWeek\": \"[letzten] dddd [um] HH:mm\", \"sameElse\": \"ddd, D MMM [um] HH:mm\" }) }}",
676+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Heute] [um] HH:mm\", \"nextDay\": \"[Morgen] [um] HH:mm\", \"lastDay\": \"[Gestern] [um] HH:mm\", \"nextWeek\": \"dddd [um] HH:mm\", \"lastWeek\": \"[letzten] dddd [um] HH:mm\", \"sameElse\": \"dddd [um] HH:mm\" }) }}",
676677
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Heute] [um] HH:mm\", \"nextDay\": \"[Morgen] [um] HH:mm\", \"lastDay\": \"[Gestern] [um] HH:mm\", \"nextWeek\": \"dddd [um] HH:mm\", \"lastWeek\": \"[letzten] dddd [um] HH:mm\", \"sameElse\": \"ddd, D MMM [um] HH:mm\" }) }}",
677678
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
678679
"To start recording, allow the camera access in your browser": "Um mit der Aufnahme zu beginnen, erlauben Sie den Zugriff auf die Kamera in Ihrem Browser",

โ€Žsrc/i18n/en.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@
673673
"timestamp/relativeWeeksAgo": "{{ count }}w ago",
674674
"timestamp/relativeYesterday": "Yesterday",
675675
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Today] [at] HH:mm\", \"nextDay\": \"[Tomorrow] [at] HH:mm\", \"lastDay\": \"[Yesterday] [at] HH:mm\", \"nextWeek\": \"dddd [at] HH:mm\", \"lastWeek\": \"[Last] dddd [at] HH:mm\", \"sameElse\": \"ddd, D MMM [at] HH:mm\" }) }}",
676+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Today] [at] HH:mm\", \"nextDay\": \"[Tomorrow] [at] HH:mm\", \"lastDay\": \"[Yesterday] [at] HH:mm\", \"nextWeek\": \"dddd [at] HH:mm\", \"lastWeek\": \"[Last] dddd [at] HH:mm\", \"sameElse\": \"dddd [at] HH:mm\" }) }}",
676677
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Today] [at] HH:mm\", \"nextDay\": \"[Tomorrow] [at] HH:mm\", \"lastDay\": \"[Yesterday] [at] HH:mm\", \"nextWeek\": \"dddd [at] HH:mm\", \"lastWeek\": \"[Last] dddd [at] HH:mm\", \"sameElse\": \"ddd, D MMM [at] HH:mm\" }) }}",
677678
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
678679
"To start recording, allow the camera access in your browser": "To start recording, allow the camera access in your browser",

โ€Žsrc/i18n/es.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@
699699
"timestamp/relativeWeeksAgo": "hace {{ count }} sem",
700700
"timestamp/relativeYesterday": "Ayer",
701701
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Hoy] [a las] HH:mm\", \"nextDay\": \"[Maรฑana] [a las] HH:mm\", \"lastDay\": \"[Ayer] [a las] HH:mm\", \"nextWeek\": \"dddd [a las] HH:mm\", \"lastWeek\": \"[รšltimo] dddd [a las] HH:mm\", \"sameElse\": \"ddd, D MMM [a las] HH:mm\" }) }}",
702+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Hoy] [a las] HH:mm\", \"nextDay\": \"[Maรฑana] [a las] HH:mm\", \"lastDay\": \"[Ayer] [a las] HH:mm\", \"nextWeek\": \"dddd [a las] HH:mm\", \"lastWeek\": \"[รšltimo] dddd [a las] HH:mm\", \"sameElse\": \"dddd [a las] HH:mm\" }) }}",
702703
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Hoy] [a las] HH:mm\", \"nextDay\": \"[Maรฑana] [a las] HH:mm\", \"lastDay\": \"[Ayer] [a las] HH:mm\", \"nextWeek\": \"dddd [a las] HH:mm\", \"lastWeek\": \"[รšltimo] dddd [a las] HH:mm\", \"sameElse\": \"ddd, D MMM [a las] HH:mm\" }) }}",
703704
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
704705
"To start recording, allow the camera access in your browser": "Para comenzar a grabar, permita el acceso a la cรกmara en su navegador",

โ€Žsrc/i18n/fr.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@
699699
"timestamp/relativeWeeksAgo": "il y a {{ count }} sem",
700700
"timestamp/relativeYesterday": "Hier",
701701
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Aujourd'hui] [ร ] HH:mm\", \"nextDay\": \"[Demain] [ร ] HH:mm\", \"lastDay\": \"[Hier] [ร ] HH:mm\", \"nextWeek\": \"dddd [ร ] HH:mm\", \"lastWeek\": \"dddd [dernier ร ] HH:mm\", \"sameElse\": \"ddd, D MMM [ร ] HH:mm\" }) }}",
702+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Aujourd'hui] [ร ] HH:mm\", \"nextDay\": \"[Demain] [ร ] HH:mm\", \"lastDay\": \"[Hier] [ร ] HH:mm\", \"nextWeek\": \"dddd [ร ] HH:mm\", \"lastWeek\": \"dddd [dernier ร ] HH:mm\", \"sameElse\": \"dddd [ร ] HH:mm\" }) }}",
702703
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Aujourd'hui] [ร ] HH:mm\", \"nextDay\": \"[Demain] [ร ] HH:mm\", \"lastDay\": \"[Hier] [ร ] HH:mm\", \"nextWeek\": \"dddd [ร ] HH:mm\", \"lastWeek\": \"dddd [dernier ร ] HH:mm\", \"sameElse\": \"ddd, D MMM [ร ] HH:mm\" }) }}",
703704
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
704705
"To start recording, allow the camera access in your browser": "Pour commencer l'enregistrement, autorisez l'accรจs ร  la camรฉra dans votre navigateur",

โ€Žsrc/i18n/hi.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@
674674
"timestamp/relativeWeeksAgo": "{{ count }} เคธเคชเฅเคคเคพเคน เคชเคนเคฒเฅ‡",
675675
"timestamp/relativeYesterday": "เคฌเฅ€เคคเคพ เค•เคฒ",
676676
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[เค†เคœ] HH:mm\", \"nextDay\": \"[เค•เคฒ] HH:mm\", \"lastDay\": \"[เคฌเฅ€เคคเคพ เค•เคฒ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"[เคชเคฟเค›เคฒเฅ‡] dddd, HH:mm\", \"sameElse\": \"ddd, D MMM HH:mm\" }) }}",
677+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[เค†เคœ] HH:mm\", \"nextDay\": \"[เค•เคฒ] HH:mm\", \"lastDay\": \"[เคฌเฅ€เคคเคพ เค•เคฒ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"[เคชเคฟเค›เคฒเฅ‡] dddd, HH:mm\", \"sameElse\": \"dddd HH:mm\" }) }}",
677678
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[เค†เคœ] HH:mm\", \"nextDay\": \"[เค•เคฒ] HH:mm\", \"lastDay\": \"[เคฌเฅ€เคคเคพ เค•เคฒ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"[เคชเคฟเค›เคฒเฅ‡] dddd, HH:mm\", \"sameElse\": \"ddd, D MMM HH:mm\" }) }}",
678679
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
679680
"To start recording, allow the camera access in your browser": "เคฐเคฟเค•เฅ‰เคฐเฅเคกเคฟเค‚เค— เคถเฅเคฐเฅ‚ เค•เคฐเคจเฅ‡ เค•เฅ‡ เคฒเคฟเค, เค…เคชเคจเฅ‡ เคฌเฅเคฐเคพเค‰เคœเคผเคฐ เคฎเฅ‡เค‚ เค•เฅˆเคฎเคฐเคพ เคคเค• เคชเคนเฅเคเคš เคฆเฅ‡เค‚",

โ€Žsrc/i18n/it.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@
699699
"timestamp/relativeWeeksAgo": "{{ count }} sett fa",
700700
"timestamp/relativeYesterday": "Ieri",
701701
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Oggi] [alle] HH:mm\", \"nextDay\": \"[Domani] [alle] HH:mm\", \"lastDay\": \"[Ieri] [alle] HH:mm\", \"nextWeek\": \"dddd [alle] HH:mm\", \"lastWeek\": \"[lo scorso] dddd [alle] HH:mm\", \"sameElse\": \"ddd, D MMM [alle] HH:mm\" }) }}",
702+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Oggi] [alle] HH:mm\", \"nextDay\": \"[Domani] [alle] HH:mm\", \"lastDay\": \"[Ieri] [alle] HH:mm\", \"nextWeek\": \"dddd [alle] HH:mm\", \"lastWeek\": \"[lo scorso] dddd [alle] HH:mm\", \"sameElse\": \"dddd [alle] HH:mm\" }) }}",
702703
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[Oggi] [alle] HH:mm\", \"nextDay\": \"[Domani] [alle] HH:mm\", \"lastDay\": \"[Ieri] [alle] HH:mm\", \"nextWeek\": \"dddd [alle] HH:mm\", \"lastWeek\": \"[lo scorso] dddd [alle] HH:mm\", \"sameElse\": \"ddd, D MMM [alle] HH:mm\" }) }}",
703704
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
704705
"To start recording, allow the camera access in your browser": "Per iniziare a registrare, consenti l'accesso alla fotocamera nel tuo browser",

โ€Žsrc/i18n/ja.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@
658658
"timestamp/relativeWeeksAgo": "{{ count }}้€ฑ้–“ๅ‰",
659659
"timestamp/relativeYesterday": "ๆ˜จๆ—ฅ",
660660
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[ไปŠๆ—ฅ] HH:mm\", \"nextDay\": \"[ๆ˜Žๆ—ฅ] HH:mm\", \"lastDay\": \"[ๆ˜จๆ—ฅ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"dddd HH:mm\", \"sameElse\": \"ddd, D MMM HH:mm\" }) }}",
661+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[ไปŠๆ—ฅ] HH:mm\", \"nextDay\": \"[ๆ˜Žๆ—ฅ] HH:mm\", \"lastDay\": \"[ๆ˜จๆ—ฅ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"dddd HH:mm\", \"sameElse\": \"dddd HH:mm\" }) }}",
661662
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[ไปŠๆ—ฅ] HH:mm\", \"nextDay\": \"[ๆ˜Žๆ—ฅ] HH:mm\", \"lastDay\": \"[ๆ˜จๆ—ฅ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"dddd HH:mm\", \"sameElse\": \"ddd, D MMM HH:mm\" }) }}",
662663
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
663664
"To start recording, allow the camera access in your browser": "้Œฒ้Ÿณใ‚’้–‹ๅง‹ใ™ใ‚‹ใซใฏใ€ใƒ–ใƒฉใ‚ฆใ‚ถใƒผใงใ‚ซใƒกใƒฉใธใฎใ‚ขใ‚ฏใ‚ปใ‚นใ‚’่จฑๅฏใ—ใฆใใ ใ•ใ„",

โ€Žsrc/i18n/ko.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@
658658
"timestamp/relativeWeeksAgo": "{{ count }}์ฃผ ์ „",
659659
"timestamp/relativeYesterday": "์–ด์ œ",
660660
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[์˜ค๋Š˜] HH:mm\", \"nextDay\": \"[๋‚ด์ผ] HH:mm\", \"lastDay\": \"[์–ด์ œ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"[์ง€๋‚œ] dddd HH:mm\", \"sameElse\": \"ddd, D MMM HH:mm\" }) }}",
661+
"timestamp/SchedulePreset": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[์˜ค๋Š˜] HH:mm\", \"nextDay\": \"[๋‚ด์ผ] HH:mm\", \"lastDay\": \"[์–ด์ œ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"[์ง€๋‚œ] dddd HH:mm\", \"sameElse\": \"dddd HH:mm\" }) }}",
661662
"timestamp/ScheduledMessage": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { \"sameDay\": \"[์˜ค๋Š˜] HH:mm\", \"nextDay\": \"[๋‚ด์ผ] HH:mm\", \"lastDay\": \"[์–ด์ œ] HH:mm\", \"nextWeek\": \"dddd HH:mm\", \"lastWeek\": \"[์ง€๋‚œ] dddd HH:mm\", \"sameElse\": \"ddd, D MMM HH:mm\" }) }}",
662663
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
663664
"To start recording, allow the camera access in your browser": "๋ธŒ๋ผ์šฐ์ €์—์„œ ์นด๋ฉ”๋ผ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•˜์—ฌ ๋…น์Œ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค",

0 commit comments

Comments
ย (0)