Hi, I am creating a time blocking app, so when a user sets a block of time, it should not be in the past.
is there a way to use the time picker to do this? At the moment, I cannot get it to just show the time and I can’t work out how to restrict the time to the future.
is there a plugin that will do this? I have tried Air date and time dropper
how do I go about doing this? Is there a better way?
Well I’m not sure exactly what you’re doing (or how you’re doing it).
But, assuming you’re using an option set for your timeslots, you can just get the current date/time and extract the hours and minutes then compare those to number attributes on your option set.
That’s probably the approach I would take.
If you’re talking about a Date, that’s a different question. In that case all you need to do is compare the current date time to the dates in question.
If, specifically, you’re talking about using a date/time picker, then just put the minimum date as the current date/time.
Ah, also, when I remove the minimum hour constraint, I can see that the time picker intervals are every half hour, I definitely need to let my users select a specific time…