-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calendar: with showTime and hourFormat="24" time hour is set to 00 on day change #5248
Comments
Thanks a lot for your report! I set a milestone for it. We'll check before the milestone is released. |
in Calendar.vue component you should edit this 2 things: selectDate(dateMeta) {
let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
// ADD THESE LINES
if (this.modelValue) {
date.setHours(this.modelValue.getHours(), this.modelValue.getMinutes());
}
// CONTINUE CODE
if (this.showTime) { ................ and this: parseDateTime(text) {
let date;
let parts = text.split(' ');
if (this.timeOnly) {
date = this.modelValue ? new Date(this.modelValue) : new Date(); //EDIT THIS LINE
this.populateTime(date, parts[0], parts[1]);
} else {............ |
primevue": "^3.49.1" |
you need also to edit all calendar files such as *.esm.js of components you try to edit |
Fixed with: #5620 |
Describe the bug
The calendar does not work properly when used with showTime and hourFormat="24".
When you select a day the hours are set to 00, only with hoursFormat="24"
Reproducer
https://stackblitz.com/edit/primevue-nuxt-issue-template-pfzbwe?file=app.vue
PrimeVue version
3.48.1
Vue version
3.x
Language
TypeScript
Build / Runtime
Nuxt
Browser(s)
All browsers
Steps to reproduce the behavior
Run stackblitz, click on the input calendar and select a day, the hours are always set to 00
Expected behavior
The hours should not be updated to 00
The text was updated successfully, but these errors were encountered: