Yvan,
It must be like this.
$(document).ready(function() {
$("#arrive").datepicker({minDate: new Date(2009, 11 - 1,
6),onClose:setDepart});
$('#arrive').datepicker();
});
Grz,
Steven
Webdeveloper
http://www.b-hind.eu
http://www.lotsofdots.be
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Yvan
Sent: dinsdag 28 juli 2009 20:59
To: jQuery UI
Subject: [jquery-ui] Re: Datepicker question - making the first choosable
"depart" date the day after the chosen "arrive" date
I can't get it to work. Here are my 2 javascripts:
<script type="text/javascript">
function setDepart(input){
var day = $("#arrive").datepicker("getDate");
day.setDate(day.getDate()+1);
$("#depart").datepicker( 'setDate' ,day);
}
$(document).ready(function() {
$("#arrive").datepicker({minDate: new Date(2009, 11 - 1, 6)});
$('#arrive').datepicker();
$("#arrive").datepicker({onClose:setDepart});
$('#calendar-trigger-arrive').click(function() {
$('#arrive').datepicker('show');
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#depart').datepicker();
$('#calendar-trigger-depart').click(function() {
$('#depart').datepicker('show');
});
});
</script>
On Jul 28, 2:49 pm, Steven Lots <[email protected]> wrote:
> Hey Yvan,
>
> than you need to call a function when changing the arrive date and set
> the depart date
>
> $(document).ready(function() {
> $("#arrive").datepicker({onClose:setDepart});
> $("#depart").datepicker();
>
> });
>
> function setDepart(input){
> var day = $("#arrive").datepicker("getDate");
> day.setDate(day.getDate()+1);
> $("#depart").datepicker( 'setDate' ,day);
>
> }
>
> grz,
>
> Steven Lots
> Webdeveloper
>
> http://www.b-hind.euhttp://www.lotsofdots.be
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.33/2267 - Release Date: 07/28/09
06:00:00
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---