GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — InputDateTimePicker ignores controlProps.ampm: false — picker popup shows AM/PM in 12-hour locales despite a 24-hour request · Issue #10584 · pgadmin-org/pgadmin4

InputDateTimePicker ignores controlProps.ampm: false — picker popup shows AM/PM in 12-hour locales despite a 24-hour request #10584

New issue
Copy link
New issue
Copy link
Closed
Closed
InputDateTimePicker ignores controlProps.ampm: false — picker popup shows AM/PM in 12-hour locales despite a 24-hour request#10584
Copy link
Labels
Bug

Description

@VIBVEL47
VIBVEL47
opened on Oct 15, 2026
Issue body actions

Describe the bug

InputDateTimePicker (and FormInputDateTimePicker) in web/pgadmin/static/js/components/FormComponents.jsx accepts controlProps.ampm to choose between 12-hour and 24-hour time. When a caller explicitly passes controlProps={{ ampm: false }} to request 24-hour time, the setting is honored for the text field format but not for the picker popup's time columns.

The cause is a truthiness check that collapses an explicit false to undefined:

// web/pgadmin/static/js/components/FormComponents.jsx (~line 340)
ampm: controlProps.ampm ? controlProps.ampm : undefined,
Because false ? ... : undefined evaluates to undefined, the ampm prop is never forwarded to the underlying MUI X DateTimePicker/TimePicker. MUI then derives 12h vs 24h from the active locale, so in a 12-hour locale (e.g. the default en-US) the popup renders an AM/PM meridiem column even though the caller asked for 24-hour time (and the text field itself shows 24-hour values). ampm: true works; only the explicit false is lost.

To Reproduce

Steps to reproduce the behavior:

Render an InputDateTimePicker (or FormInputDateTimePicker) with controlProps={{ ampm: false }} in a browser/OS using a 12-hour locale (e.g. English (United States)).
Observe the text field format — it correctly uses 24-hour yyyy-MM-dd HH:mm:ss.
Click the calendar/clock icon to open the picker popup and view the time selector.
See that the time columns include an AM / PM column (12-hour), instead of a 24-hour (00–23) hour column.
Expected behavior

With controlProps={{ ampm: false }}, the picker popup should also use 24-hour time (no AM/PM column), consistent with the 24-hour text field — regardless of the browser/OS locale.

Error message

None — no error is thrown; the time selector silently renders in the wrong (12-hour) mode.

Screenshots

(Attach if filing: the opened date-time picker popup showing an AM/PM column while the input field shows 24-hour text.)

Desktop (please complete the following information):

OS: [e.g. macOS Sequoia / Windows 11]
pgAdmin version: [your version — the code at FormComponents.jsx ~line 340 on current master]
Mode: Both (Desktop and Server) — it is a frontend component issue
Browser (if running in server mode): Any in a 12-hour locale (e.g. Chrome with en-US)
Package type: Any (frontend/JS)
Additional context

File/line: web/pgadmin/static/js/components/FormComponents.jsx, in the commonProps object (~line 340): ampm: controlProps.ampm ? controlProps.ampm : undefined.
Suggested fix: forward the explicit value instead of coercing it, e.g. ampm: controlProps.ampm ?? undefined (or 'ampm' in controlProps ? controlProps.ampm : undefined). This preserves false while keeping the "unset ⇒ locale default" behavior for callers that pass nothing.
Impact: every consumer that passes ampm: false gets a 24-hour text field but a 12-hour popup in 12-hour locales, an inconsistent UI.
MUI X derives the clock's 12h/24h from ampm; when it is undefined it falls back to the adapter locale, which is why the symptom is locale-dependent.

Activity

  1. VIBVEL47
    added
    Bug
    on Oct 15, 2026
  2. dpage
    added a commit that references this issue on Oct 15, 2026

    Preserve explicit 24-hour mode in date-time picker popups. #10584 (#1…

    5063c76
  3. dpage commented on Oct 15, 2026

    @dpage
    dpage
    on Oct 15, 2026
    Contributor
    More actions

    Fixed in 5063c76 (#10596).

  4. dpage
    closed this as completedon Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.