Conversation
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9377c6979e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const timeValue = values[INPUT_IDS.TIME]?.trim(); | ||
| if (timeValue && !/^(1[0-2]|0?[1-9])(:[0-5]\d)?$/.test(timeValue)) { | ||
| addErrorMessage(errors, INPUT_IDS.TIME, translate('chronos.invalidTimeFormat')); |
There was a problem hiding this comment.
Require AM/PM when time is provided
This validation allows a time value without timePeriod, and buildOOOCommand() only appends the period when it exists, so submitting 12:30 can generate ooo <date> 12:30 with no AM/PM. Since this form intentionally validates a 12-hour clock (1-12), the command is ambiguous and can schedule the wrong half-day OOO window when users forget to pick AM/PM. Please require timePeriod whenever time is filled (or provide a default) before submission.
Useful? React with 👍 / 👎.
|
@dukenv0307 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
🦜 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/de.ts b/src/languages/de.ts
index 9f5f39b2..2a2a602d 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7862,7 +7862,7 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
reason: 'Grund',
workingPercentage: 'Arbeitsprozentsatz',
dateRequired: 'Datum ist erforderlich.',
- invalidTimeFormat: 'Bitte geben Sie eine gültige Uhrzeit ein (z. B. 12:30).',
+ invalidTimeFormat: 'Bitte geben Sie eine gültige Uhrzeit im 24‑Stunden-Format ein (z. B. 14:30).',
enterANumber: 'Bitte geben Sie eine Zahl ein.',
hour: 'Stunden',
day: 'Tage',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index a0819934..58cbc443 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -7877,7 +7877,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
startTimer: 'Démarrer le minuteur',
stopTimer: 'Arrêter le minuteur',
scheduleOOO: 'Planifier une absence',
- scheduleOOOTitle: 'Programmer une absence du bureau',
+ scheduleOOOTitle: 'Planifier une absence du bureau',
date: 'Date',
time: 'Heure',
durationAmount: 'Montant',
@@ -7885,7 +7885,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
reason: 'Raison',
workingPercentage: 'Pourcentage de travail',
dateRequired: 'La date est obligatoire.',
- invalidTimeFormat: 'Veuillez saisir une heure valide (p. ex. 12:30).',
+ invalidTimeFormat: 'Veuillez entrer une heure valide au format 24 heures (par ex. 14:30).',
enterANumber: 'Veuillez saisir un nombre.',
hour: 'heures',
day: 'jours',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index b09d9ab0..8c9b7391 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7843,15 +7843,15 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
startTimer: 'Avvia timer',
stopTimer: 'Ferma timer',
scheduleOOO: 'Pianifica OOO',
- scheduleOOOTitle: 'Pianifica assenza dall’ufficio',
+ scheduleOOOTitle: 'Programma assenza dall’ufficio',
date: 'Data',
time: 'Ora',
durationAmount: 'Importo',
durationUnit: 'Unità',
reason: 'Motivo',
- workingPercentage: 'Percentuale di lavoro',
+ workingPercentage: 'Percentuale lavorativa',
dateRequired: 'La data è obbligatoria.',
- invalidTimeFormat: 'Inserisci un orario valido (ad es. 12:30).',
+ invalidTimeFormat: 'Inserisci un orario valido nel formato 24 ore (ad es. 14:30).',
enterANumber: 'Inserisci un numero.',
hour: 'ore',
day: 'giorni',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 7420008d..4e48a8ad 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7746,15 +7746,15 @@ ${reportName}
startTimer: 'タイマー開始',
stopTimer: 'タイマーを停止',
scheduleOOO: '不在予定を設定',
- scheduleOOOTitle: '外出予定を設定',
+ scheduleOOOTitle: '不在予定を設定',
date: '日付',
time: '時間',
durationAmount: '金額',
durationUnit: '単位',
reason: '理由',
- workingPercentage: '作業率',
+ workingPercentage: '稼働率',
dateRequired: '日付は必須です。',
- invalidTimeFormat: '有効な時刻を入力してください(例: 12:30)。',
+ invalidTimeFormat: '有効な24時間表記の時刻を入力してください(例: 14:30)。',
enterANumber: '数字を入力してください。',
hour: '時間',
day: '日数',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 1ecc8982..af1891d1 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7819,7 +7819,7 @@ Voeg meer bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
oooEventSummaryPartialDay: (summary: string, timePeriod: string, date: string) => `${summary} van ${timePeriod} op ${date}`,
startTimer: 'Timer starten',
stopTimer: 'Timer stoppen',
- scheduleOOO: 'OOO plannen',
+ scheduleOOO: 'Afwezigheid plannen',
scheduleOOOTitle: 'Afwezigheid plannen',
date: 'Datum',
time: 'Tijd',
@@ -7827,8 +7827,8 @@ Voeg meer bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
durationUnit: 'Eenheid',
reason: 'Reden',
workingPercentage: 'Werkpercentage',
- dateRequired: 'Datum is vereist.',
- invalidTimeFormat: 'Voer een geldige tijd in (bijv. 12:30).',
+ dateRequired: 'Datum is verplicht.',
+ invalidTimeFormat: 'Voer een geldige 24-uurs tijd in (bijv. 14:30).',
enterANumber: 'Voer een getal in.',
hour: 'uren',
day: 'dagen',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 755d478e..4985470f 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7815,9 +7815,9 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
durationAmount: 'Kwota',
durationUnit: 'Jednostka',
reason: 'Powód',
- workingPercentage: 'Działający procent',
+ workingPercentage: 'Procent pracy',
dateRequired: 'Data jest wymagana.',
- invalidTimeFormat: 'Wprowadź prawidłowy czas (np. 12:30).',
+ invalidTimeFormat: 'Podaj poprawny czas w formacie 24-godzinnym (np. 14:30).',
enterANumber: 'Wpisz liczbę.',
hour: 'godziny',
day: 'dni',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 32e97429..edfb9d0e 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7813,16 +7813,16 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
startTimer: 'Iniciar cronômetro',
stopTimer: 'Parar cronômetro',
scheduleOOO: 'Agendar ausência',
- scheduleOOOTitle: 'Programar ausência do escritório',
+ scheduleOOOTitle: 'Agendar ausência do escritório',
date: 'Data',
- time: 'Hora',
+ time: 'Tempo',
durationAmount: 'Valor',
durationUnit: 'Unidade',
reason: 'Motivo',
workingPercentage: 'Porcentagem de trabalho',
dateRequired: 'A data é obrigatória.',
- invalidTimeFormat: 'Insira um horário válido (por exemplo, 12:30).',
- enterANumber: 'Por favor, insira um número.',
+ invalidTimeFormat: 'Insira um horário válido no formato 24 horas (por exemplo, 14:30).',
+ enterANumber: 'Insira um número.',
hour: 'horas',
day: 'dias',
week: 'semanas',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 28bf59b3..77d82e2f 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7613,12 +7613,12 @@ ${reportName}
reason: '原因',
workingPercentage: '工作百分比',
dateRequired: '日期为必填项。',
- invalidTimeFormat: '请输入有效的时间(例如:12:30)。',
+ invalidTimeFormat: '请输入有效的 24 小时制时间(例如:14:30)。',
enterANumber: '请输入一个数字。',
hour: '小时',
day: '天',
week: '周',
- month: '月数',
+ month: '个月',
},
footer: {
features: '功能',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
src/languages/es.ts
Outdated
| reason: 'Motivo', | ||
| workingPercentage: 'Porcentaje de trabajo', | ||
| dateRequired: 'La fecha es obligatoria.', | ||
| invalidTimeFormat: 'Ingresa una hora válida (ej., 12:30).', |
|
We're building the ooo message in English only, is it expected? |
|
I see the AM/PM selector in your screenshot but it doesn't appear on my side |
|
@Expensify/design For more eyes |
|
Also, how does the date work? Can you select a range for multiple days? |
|
Dig those tweak suggestions 👍 |
Yeah, Chronos can only understand English, so that's fine. The time needs to be in 24-hour format for now (without making any changes to Chronos), so I will update my screenshot, double-check that translation, and the designs will need to account for that. I like the unit selector idea @shawnborton and I'll use that if it's already built. If it's not built yet, let's just keep what we have an can swap it out later.
It's a single date selector that is used in the Chronos message. You configure a range by using the "amount" and "unit" fields (ie. "for 6 days") |




Fixed Issues
$ https://github.com/Expensify/Expensify/issues/622509
Tests
Offline tests
Same
QA Steps
Same
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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps./** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari