Skip to content

Preserve explicit 24-hour mode in date-time picker popups. #10584 - #10596

Closed
MaybeSomeone-arc18 wants to merge 2 commits into
pgadmin-org:masterfrom
MaybeSomeone-arc18:fix-10584-picker-24h
Closed

MaybeSomeone-arc18 wants to merge 2 commits into
pgadmin-org:masterfrom
MaybeSomeone-arc18:fix-10584-picker-24h

Conversation

@MaybeSomeone-arc18

@MaybeSomeone-arc18 MaybeSomeone-arc18 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10584.

The truthiness check turned ampm: false into undefined, so MUI used the locale's default clock mode instead. Forward the value directly: false stays false, true stays true, and an omitted setting stays undefined.

Added nine regression cases for Date, Time and DateTime pickers with false, true and an omitted setting. On unchanged master the three false cases fail; with the fix all 61 tests pass across this suite and the existing FormComponents suite.

Also built a local component harness using the actual InputDateTimePicker, pgAdmin theme and MUI pickers. In Chrome with en-US locale, both Time and DateTime popups show 24-hour columns without AM/PM when ampm is false. This was component-level verification, not a full pgAdmin end-to-end run. ESLint could not run with the available dependencies because its config loader errors before linting.

AI assistance was used for the patch and tests.

Summary by CodeRabbit

  • Bug Fixes
    • Date, time, and date-time pickers now consistently respect the configured AM/PM setting, including when it is disabled or unspecified.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pgadmin-org/pgadmin4/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94b34473-173e-4d56-af18-f18655a11344
📥 Commits

Reviewing files that changed from the base of the PR and between 607c9ec and d402fc6.

📒 Files selected for processing: 2
  • web/pgadmin/static/js/components/FormComponents.jsx
  • web/regression/javascript/components/InputDateTimePicker.spec.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

InputDateTimePicker now forwards the ampm setting unchanged to its picker components. Tests cover false, true, and undefined.

Changes

Date-time picker AM/PM setting

Layer / File(s) Summary
Forward the setting and verify picker props
web/pgadmin/static/js/components/FormComponents.jsx, web/regression/javascript/components/InputDateTimePicker.spec.js
InputDateTimePicker now forwards controlProps.ampm without converting false to undefined. Tests verify that Date, Time, and DateTime picker components receive false, true, and undefined unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: dpage

Merge Risk: ⚪ Minimal · up to d402f

The picker change appears ready to merge after normal checks; no outstanding issue is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: preserving explicit 24-hour mode in date-time picker popups.
Linked Issues check Passed Issue #10584 requires InputDateTimePicker and its FormInputDateTimePicker wrapper to preserve controlProps.ampm, including explicit false, while leaving an omitted value undefined. At the revi…
Out of Scope Changes check Passed The reviewed changes are limited to the ampm forwarding fix in FormComponents.jsx and regression tests for the three picker types and three supported value states. The tests directly verify the be…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dpage

dpage commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Thanks! Merged as 5063c76, with two small fixes folded in: the unused React import in the new spec (it failed ESLint), and ampm is no longer forwarded to the Date picker, since DatePicker has no clock and passes the prop through to the DOM, which made React log a non-boolean attribute error for the debugger's Date fields. The Date test cases now assert that ampm is omitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants