DMXzone Calendar 2 Support Product Page

Setting the minimum time of a date picker to the time of another datepicker on the form

Asked 23 May 2012 15:57:56
1
has this question
23 May 2012 15:57:56 Meindert Biesheuvel posted:
I want to use a form with two date/time pickers. It's used as event from and to.

I want to restrict the minimum date of the second date/time picker so that the minimum date/time is at least the date time of the first date time picker.

That's because events don't end up from lets say 3pm to 1 pm three days before start date/time, that's a litle strange.

How can I write a javascript function that sets the minimum datetime of a date picker according to the selected date/time of anohter date/time picker?

TIA

Replies

Replied 23 May 2012 19:05:57
23 May 2012 19:05:57 Meindert Biesheuvel replied:
Ok, lets change the question, if found that you can set the minimum date from one datepicker to another. You can also set the minimum time form one time picker to another.

But when the time picker is used as an add on you can only set the minimum date to another date picker.

So you can still and up with input like

Begin:
3 -dec - 2012 13:00

End
3 - dec - 2012 9:00

Witch means that te end of the event is earlier then the begin.

So you would think let's put the date pickers and the time pickers on the form seperatly, but then you cant's have an event like

Begin:
3 -dec- 9:00

End
4 - dec - 8:00

This is because the timepicker won't accept that you have a time earlier then the initial begin time. And if you don't apply the behaviour of setting the minimum time from the begin timepicker you end up with the same problem before.

I hope that there's going to be a fix for that, since the timepicker and the datepicker are beautiful tools.

I hope that there is going to be a fix for that

Reply to this topic