That's close, ... but I'm still not quite there. 1) I don't want the "arrive" text input box to get prepopulated with any values at all
2) If I choose "November 6" .. as the arrive date ... The earliest date that I can choose from the "depart" datepicker should be no earlier than "November 7". (Your example allows me to choose the dates that are greater than November 6 PLUS November 6. - yg On Jul 28, 3:32 pm, "Steven Lots" <[email protected]> wrote: > Yvan > > I think you mean this? > > <script type="text/javascript"> > $(document).ready(function() { > $("#arrive").datepicker({ > minDate: new Date(2009, 11 - 1, 6), > onSelect: function(dateText, inst){ > $("#depart").datepicker("option","minDate", > new Date(dateText)); > var day = > $("#arrive").datepicker("getDate"); > day.setDate(day.getDate()+1); > $("#depart").datepicker( 'setDate' ,day); > } > }); > $('#calendar-trigger-arrive').click(function() { > $('#arrive').datepicker('show'); > }); > }); > </script> > > Grz, > > Steven > Webdeveloper > > http://www.b-hind.euhttp://www.lotsofdots.be > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > > Behalf Of Yvan > Sent: dinsdag 28 juli 2009 21:25 > To: jQuery UI > Subject: [jquery-ui] Re: Datepicker question - making the first choosable > "depart" date the day after the chosen "arrive" date > > Ideally -- I'd like to update the following script so that it achieves > the functionality that I need: > > <script type="text/javascript"> > $(document).ready(function() { > $("#arrive").datepicker({ > minDate: new Date(2009, 11 - 1, 6), > onSelect: function(dateText, inst) > { $("#depart").datepicker("option","minDate", > new Date > (dateText)); } > }); > $('#arrive').datepicker(); > $('#calendar-trigger-arrive').click(function() { > $('#arrive').datepicker('show'); > }); > }); > </script> > > This script sets the depart date to the same value that was selected > using the arrive datepicker. > I need it to somehow set the arrive date to the depart date + 1. > > Working > Example:http://www.theseagatehotel.com/www.theseagatehotel.com/index.html > > - yg > > On Jul 28, 3:18 pm, Yvan <[email protected]> wrote: > > Hmm, .. this isn't what I wanted to achieve. This is prepopulating > > the "depart" text input box. > > > Here is what I need (quoted from my original post): > > > when you choose an "Arrive" date, .... the first choosable "Depart" > > date would be automatically updated to be 1 day after the chosen > > "arrive" date? > > > For example, .. if I was to choose November 6th from the "Arrive" > > datepicker, .. the first choosable date in the "Depart" datepicker > > should be dynamically set to November 7th, .. and all dates before > > November 7th in that "Depart" datepicker should be grayed out and un- > > clickable. > > > - yg > > > On Jul 28, 3:11 pm, "Steven Lots" <[email protected]> wrote: > > > > 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.euhttp://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 > > 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 -~----------~----~----~----~------~----~------~--~---
