Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DatePicker today button inconsistent with time #17724

Open
2 of 4 tasks
Farbfetzen opened this issue Feb 20, 2025 · 0 comments
Open
2 of 4 tasks

DatePicker today button inconsistent with time #17724

Farbfetzen opened this issue Feb 20, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@Farbfetzen
Copy link

Farbfetzen commented Feb 20, 2025

Describe the bug

Clicking the today button in a DatePicker with showTime sets the current date and time as expected if the input is empty. However, if the input already contains a value then only the date is changed to the current date but the time remains unchanged.

I encountered the problem using PrimeNG 19, but it also happens with 18. The stackblitz reproducer uses PrimeNG 18 with p-calendar because I can't update the version there without stackblitz breaking.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/github-sww9u6cd?file=src%2Fapp%2Fapp.component.html

Environment

Windows 11

Angular version

19.1.5

PrimeNG version

v19

Node version

v20.18.1

Browser(s)

Firefox and Chrome

Steps to reproduce the behavior

  1. Create a datepicker with a button bar and showTime: <p-date-picker [showButtonBar]="true" [showTime]="true" />
  2. Enter a random date and time, e.g. "02/12/2025 14:37"
  3. Click the today button.
  4. The date changes to the current date but the time remains unchanged.

Expected behavior

The time should change to the current time as is the case when clicking the button if the input is empty.

@Farbfetzen Farbfetzen added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 20, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant