[Payment due @FitseTLT] Add end date picker with two-way duration sync on Schedule OOO#94314
Conversation
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/es.ts b/src/languages/es.ts
index a4cea1d3904..5c06301507b 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -8069,14 +8069,14 @@ ${amount} para ${merchant} - ${date}`,
scheduleOOO: 'Programar ausencia',
scheduleOOOTitle: 'Programar fuera de oficina',
date: 'Fecha de inicio',
- endDate: 'Fecha de fin',
+ endDate: 'Fecha de finalización',
time: 'Hora (formato de 24 horas)',
durationAmount: 'Duración',
durationUnit: 'Unidad',
reason: 'Motivo',
workingPercentage: 'Porcentaje de trabajo',
dateRequired: 'La fecha de inicio es obligatoria.',
- endDateBeforeStart: 'La fecha de fin no puede ser anterior a la fecha de inicio.',
+ endDateBeforeStart: 'La fecha de finalización no puede ser anterior a la fecha de inicio.',
invalidTimeFormat: 'Ingresa una hora válida (ej., 14:30).',
enterANumber: 'Ingresa un número.',
hour: 'horas',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 02f06c82c65..ac2835d12fb 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -8175,8 +8175,8 @@ ${reportName}
durationUnit: '単位',
reason: '理由',
workingPercentage: '稼働率',
- dateRequired: '開始日は必須です。',
- endDateBeforeStart: '終了日を開始日より前にすることはできません。',
+ dateRequired: '開始日が必要です。',
+ endDateBeforeStart: '終了日は開始日より前にはできません。',
invalidTimeFormat: '有効な24時間表記の時刻を入力してください(例: 14:30)。',
enterANumber: '数字を入力してください。',
hour: '時間',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 9f0663ef2fc..bb4cbbbf627 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -8249,7 +8249,7 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
reason: 'Reden',
workingPercentage: 'Werkpercentage',
dateRequired: 'Startdatum is verplicht.',
- endDateBeforeStart: 'De einddatum kan niet vóór de startdatum liggen.',
+ endDateBeforeStart: 'Einddatum kan niet vóór de startdatum liggen.',
invalidTimeFormat: 'Voer een geldige 24-uurs tijd in (bijv. 14:30).',
enterANumber: 'Voer een getal in.',
hour: 'uren',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 9340b7ad546..1ba0f1630da 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -8230,7 +8230,7 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
stopTimer: (duration: string) => `Zatrzymaj licznik czasu (${duration})`,
scheduleOOO: 'Zaplanuj nieobecność',
scheduleOOOTitle: 'Zaplanuj nieobecność',
- date: 'Data rozpoczęcia',
+ date: 'Data początkowa',
endDate: 'Data zakończenia',
time: 'Czas (format 24-godzinny)',
durationAmount: 'Czas trwania',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
…d updates when end date is picked
…d end date or duration
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Should I review @stitesExpensify ? |
|
Yes please @FitseTLT ! |
|
@stitesExpensify end date before start date error doesn't disallow the schedule submission. |
| return format(addDays(addMonths(start, whole), -1), CONST.DATE.FNS_FORMAT_STRING); | ||
| case CONST.CHRONOS.OOO_DURATION_UNITS.HOUR: | ||
| default: | ||
| return startDate; |
There was a problem hiding this comment.
@stitesExpensify this is more confusing. What if they input > 1 amount as long as the unit says hours users would input 4 for 4 hours What exactly is the expected behavior @tgolen
There was a problem hiding this comment.
I can see how that would be confusing. I think we should hide the the end date if the user chooses hours and just avoid that case completely
There was a problem hiding this comment.
Updated again!
There was a problem hiding this comment.
Yeah, I'm not too picky here. I think ideally, we would have two date+time pickers. Since we don't have that component, I think it makes it a little awkward for edge cases like this.
@stitesExpensify U haven't still fixed this 😄 |
|
@FitseTLT Fixed. Moving the start date past a chosen end date now clears the end date instead of leaving an invalid range, so end-before-start can't reach submission. The validation error stays as a backstop. |
|
It will trigger the error too is that ok. 2026-07-07.19-21-15.mp4 |
|
Also We don't calculate start date from end date and amount but I think that's ok because start date is required. |
That's fine IMO.
Agreed! |
|
🎯 @FitseTLT, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
🚧 stitesExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/stitesExpensify in version: 9.4.32-0 🚀
|
|
🤖 Help site review: no changes required I reviewed the changes in this PR against the help site articles in What this PR changes: It adds an end date picker to the Chronos Schedule OOO form and keeps it in sync with the existing Duration field (two-way sync). The command sent to Chronos is unchanged — the end date is a UI convenience that maps to the existing duration. Why no docs update is needed: The Chronos Schedule OOO feature (booking time off by chatting with the Chronos bot) is not documented anywhere under
Since this is a UI convenience enhancement to a feature the help site doesn't currently document, there's no existing article to update and no gap this PR introduces that requires new documentation. If you'd like a brand-new help article created to document the Chronos Schedule OOO flow (including the new end date picker), let me know and I can draft one. |
|
QA'd, checking off |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.4.32-3 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #95819 |
Explanation of Change
The Schedule OOO form currently only let you set a start date and type a duration, so you had to count the number of days you would be away. This adds an end date picker alongside the duration field and keeps the two in sync:
The end date picker cannot be set to a date before the start date, and submitting with an end date before the start date shows an error. The command sent to chronos is unchanged (
ooo {date} for {N} {unit} ...); the end date is a UI convenience that maps to the existing duration. End date math follows the backend rule that "for N units" ends at start plus the interval minus one day for full-day units.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/651493
PROPOSAL:
Tests
3in Duration with the unit set to days. Verify the end date is the start date plus 2 days.1. Verify the end date is one month after the start date minus one day.5and the unit is days.ooo {start} for {N} days ....Offline tests
QA Steps
Tag @stitesExpensify
Same as Tests, but actually book some OOO and make sure it works.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.