Page 1 of 1

TimePicker endHour/Minute type!!!

Posted: 07 Nov 2012, 16:38
by maxtorzito
Hi, im using the picker and always ask me why the timepicker use start/endHour and start/endMinute with int type and not with Date type (something like maxTime= new Date()), well apparently this can be more easy to use with int type, but i have a trouble with this, let say i want to restrict all the hours after 10:45pm, with timepicker i do this:

Code: Select all

<p:timePicker 
...
...
endHours=10
endMinutes=45
/>
But if i want choose 09:50 i cant, why? because the endMinute is 45 and im trying to select 50, yeah of course but 09:50 not 10:50, if there something that im not understanding with this attributes or its impossible to do what i want? and,,,,,, i always ask me why not use a date instead of int?

Thanks

Re: TimePicker endHour/Minute type!!!

Posted: 07 Nov 2012, 18:20
by Oleg
It works as designed. If endMinutes=45, you can not select 50. Logical? If step = 10 min., you can not go 5 min. steps. Try to look these examples please http://fgelinas.com/code/timepicker/ This is a native widget.

Re: TimePicker endHour/Minute type!!!

Posted: 07 Nov 2012, 19:04
by maxtorzito
Oleg wrote:It works as designed. If endMinutes=45, you can not select 50. Logical? If step = 10 min., you can not go 5 min. steps. Try to look these examples please http://fgelinas.com/code/timepicker/ This is a native widget.
Im not referring to step size, check this other scenario:

1. Step size of 5 for hours/minutes
2. Set startHours=5 and startMinutes=30

Then with this i expect that the user CAN select any time after 5:10, something like 6:10, 6:15, 6:30 or 7:40, with this the user CANT select any minute before 30 regardless of the hour (like 6:10, 6:15 because the minute are before 30 but the hour are after 5). I mean, i want to know if the minutes aren't consider the hours , this is the default design?

That's why i talk about use a Date not int types, with date you can say maxDate and you know that all the date before the specific date are valid.

Re: TimePicker endHour/Minute type!!!

Posted: 08 Nov 2012, 00:16
by Oleg
minDate / maxDate is a different thing. startHours / startMinutes define allowed start time. Think about time registration systems. I developed this component special for a such system. The requirement was to set start / end time and a step, so that user can decrease / increase time with step in the specified range. E.g. 08:00 - 08:15 - 08:30 - 08:45 - 09:00 - 09:15 and so on, forwards and backwards. So, start minute is here 0 and the end is 45. You can not set startHours / startMinutes and think you can't go back (decrease time). This is not minDate! The same is for endHour / endMinutes. They don't define maxDate as in calendar. They define min / max time within 1 day and 1 hour respectively. I hope I could explain it clear.