fix(frontend): honor the AM/PM date metric in the post date picker time input - #2031
giladresisi wants to merge 1 commit into
Conversation
…me input The TimeInput inside the editor's date picker popup always rendered 24h, ignoring the Date Metrics setting that the rest of the UI respects. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139MFpBVVACikM4kMYZ1F9F
Strix Security ReviewNo security issues found. Updated for Reviewed by Strix |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| /> | ||
| <TimeInput | ||
| onChange={changeDate('time')} | ||
| format={isUSCitizen() ? '12' : '24'} |
There was a problem hiding this comment.
Bug: The format prop is passed to a Mantine v5 TimeInput component, which does not support it. The prop will be ignored, and the time format will not change as intended.
Severity: MEDIUM
Suggested Fix
The TimeInput component does not support the format prop in Mantine v5. To control the time format, replace the TimeInput component with Mantine's TimePicker component, which does accept a format prop (e.g., format="12h" or format="24h").
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: apps/frontend/src/components/launches/helpers/date.picker.tsx#L76
Potential issue: The code passes a `format` prop to the Mantine v5 `TimeInput` component
to switch between 12-hour and 24-hour formats. However, the `TimeInput` component in
`@mantine/dates: "^5.10.5"` does not support the `format` prop. As a result, React will
silently ignore this prop, and the component will default to the browser's native
`input[type="time"]` behavior, which is typically a 24-hour format. The intended
functionality of displaying a 12-hour clock for certain users will not work, defeating
the purpose of the change.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Not valid. The installed @mantine/dates is 5.10.5, and its TimeInput declares format?: '12' | '24' (node_modules/@mantine/dates/lib/components/TimeInput/TimeInput.d.ts). TimePicker does not exist in v5. Verified in the browser: the field renders "01 : 40 pm" with AM/PM selected and "13 : 40" with 24 hours.
What kind of change does this PR introduce?
Bug fix (frontend, post editor date picker). The "Pick time" field inside the scheduling popup of the post editor is a Mantine
TimeInputrendered without aformatprop, so it always showed 24-hour time even when Settings > Date Metrics is set to AM:PM. This PR passesformat={isUSCitizen() ? '12' : '24'}to thatTimeInputindate.picker.tsx, matching the format the date button next to it already uses. The change handler, the calendar, and the 24-hour path are unchanged.Why was this change needed?
A customer reported on 2026-09-04 that with Date Metrics set to AM:PM, the calendar and the editor's date button show "3:19 PM" while the time field inside the scheduling popup shows "15:19", so the UI mixes both formats. The setting is meant to apply to every time display.
Other information:
Support initially told the customer the 24-hour field was intentional to avoid overlapping schedules; nothing in the code supports that, the prop was simply never set.
QA
Checklist:
Put a "X" in the boxes below to indicate you have followed the checklist;
🤖 Generated with Claude Code
https://claude.ai/code/session_0139MFpBVVACikM4kMYZ1F9F