primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Default Time for Time Picker when Clicked

Open CNitschelm opened this issue 9 years ago • 2 comments

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Note: Time Picker means Calendar Picker set to time only.

Current behavior When the time picker is clicked, the component that appears sets the default time to the current time.

Expected behavior When the time picker is clicked, the component that appears sets the default time to a time set by the developer.

Minimal reproduction of the problem with instructions Click anywhere on the time picker and see the current time.

What is the motivation / use case for changing the behavior? When selecting a time, many users want "00" as the minute. For the application I am working on, I want to be able to grab the current hour on component load and set the minute to be "00" by default. Note that this is not a request for the ability to set a default time, which is already a feature. I still want the placeholder text to be there, but the default time of the component that appears on click to be able to be customized.

Please tell us about your environment: Windows 10, VSCode

  • Angular version: 4.4.3

  • PrimeNG version: 4.2.1

  • Browser: all

  • Language: TypeScript 2.5.2

CNitschelm avatar Sep 21 '17 23:09 CNitschelm

@CNitschelm Hello,

I have some problems trying to reproduce this issue.

I used definition like this:

defaultDate: Date = new Date('Fri Sep 1 2009 00:00:00 GMT+0300 (EEST)');
<p-calendar [(ngModel)]="date11" [defaultDate]="defaultDate" [timeOnly]="true"></p-calendar>

clicked on input/picker/the rest of the page and it worked fine.

Could you provide more detail regarding this issue? Thanks

Sumragen avatar Sep 22 '17 11:09 Sumragen

Yes - that did it. Looks like I misunderstood how that worked. Thanks!

CNitschelm avatar Sep 23 '17 00:09 CNitschelm