TimePicker endHour/Minute type!!!

Community Driven Extensions Project
Post Reply
maxtorzito
Posts: 96
Joined: 19 Jan 2011, 17:00

07 Nov 2012, 16:38

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

Primefaces 5.0
Primefaces Extensions 1.2.1
Omnifaces 1.8.1
JDK 1.7.0_25
MyFaces 2.1.15
Ubuntu
Apache TomEE 1.7.0 JAX-RS

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

07 Nov 2012, 18:20

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.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

maxtorzito
Posts: 96
Joined: 19 Jan 2011, 17:00

07 Nov 2012, 19:04

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.

Primefaces 5.0
Primefaces Extensions 1.2.1
Omnifaces 1.8.1
JDK 1.7.0_25
MyFaces 2.1.15
Ubuntu
Apache TomEE 1.7.0 JAX-RS

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

08 Nov 2012, 00:16

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.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests