Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

fix(datepicker): hour decrement loops incorrectly when minDate hour i…#19561

Open
nenaki wants to merge 1 commit into
primefaces:masterfrom
nenaki:fix/datepicker-hour-decrement-mindate
Open

fix(datepicker): hour decrement loops incorrectly when minDate hour i…#19561
nenaki wants to merge 1 commit into
primefaces:masterfrom
nenaki:fix/datepicker-hour-decrement-mindate

Conversation

@nenaki

@nenaki nenaki commented May 1, 2026

Copy link
Copy Markdown

Description

Fixes incorrect behaviour in the constrainTime method where clicking
the hour decrement button causes the hour to loop incorrectly
(e.g. 9 → 11 → 10 → 9) when a minDate with a specific hour is set.

Root Cause

A switch(true) case in constrainTime was incorrectly setting
returnTimeTriple[0] = 11 and flipping this.pm = true whenever
the decremented hour was exactly one below the minDate hour.
This case was redundant as AM/PM toggling is already handled
by toggleAMPMIfNotMinDate before constrainTime is called.

Fix

Removed the redundant and incorrect case from the switch(true)
block in constrainTime.

Fixes #19557

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Hour increment/decrement buttons in DatePicker not working correctly

2 participants