primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Datepicker's "Today" button should have the label "Now"

Open frankswarm opened this issue 1 month ago • 2 comments

Describe the bug

When the showTime and the showButtonBar options are enabled, the label for the Today button should change to Now since that's the actual time that is set on the input. Today would suggest that the time should be set to 00:00:00.

Pull Request Link

No response

Reason for not contributing a PR

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

Other Reason

No response

Reproducer

https://stackblitz.com/edit/7hvsaejx?file=src%2Fapp%2Fdate-picker-time-demo.html

Environment

Angular version

20.3.1

PrimeNG version

v20

Node version

22.19.0

Browser(s)

Chrome 142.0.7444.176

Steps to reproduce the behavior

Check any example on the reproducer, all reading "Today", but actually setting the time to "Now"

Expected behavior

The button should have "Now" as a label. "Today" might be confusing when checking the outcome of the action.

frankswarm avatar Dec 01 '25 10:12 frankswarm

I wonder if this is more of a sematic issue. I haven't had the need to customize button bar before so you would have to see if the date outputs are as desired but you could use https://primeng.org/datepicker#buttonbar 's #buttonbar customizing to replace <p-button size="small" label="Today" to Now as shown in the example?

ysk3a avatar Dec 01 '25 19:12 ysk3a

It is a semantic issue indeed. Yes, the custom button bar is a possibility, but that component is used very often in our codebase, and that solution means that we need to add the custom button bar everywhere just for a label change. If there is no way around it, we will end up doing it, but the semantic issue remains.

frankswarm avatar Dec 02 '25 07:12 frankswarm