primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.64k stars 1.24k forks source link

DatePicker: Wrong hour displayed for midnight when set to timeOnly and 24h #6824

Closed Ceten closed 7 hours ago

Ceten commented 1 day ago

Describe the bug

When using the DatePicker component with timeOnly the hour jumps from 23 to 12 to 1 when changing the hour. The value in the textbox and the underlying model does change to 0 correctly. This can be seen on the PrimeVue website (https://primevue.org/datepicker/#time): image

Reproducer

https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-aeuvny?file=src%2FApp.vue

PrimeVue version

4.2.2

Vue version

3.x

Language

TypeScript

Build / Runtime

TypeScript

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-aeuvny?file=src%2FApp.vue
  2. Open the DatePicker and click the up or down button on hour to go from 23 to 00 or 01 to 00
  3. The hour in the DatePicker jumps to 12 instead of 00, the value in the textbox is correctly set to 00

Expected behavior

The value in the DatePicker between 23 and 01 should be 00 and not 12.

sivareddyuppathi commented 17 hours ago

PR: (https://github.com/primefaces/primevue/pull/6831)