Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery Datepicker 2 weeks Rage issue
    primarykey
    data
    text
    <p>I have following issue with JQuery date picker, have 2 fields and one bot are for dates I would like to have date rage starting from today date and Have ability to select in future max 2 weeks. And code below is doing it, however problem is when you first access 2nd field, first one have all the available dates from today not only 2 weeks in the future and then if you fiddle a little with fields all the dates are available in 1st fields from the past. Please help</p> <p><a href="http://jsfiddle.net/tpx9X/2/" rel="nofollow">PLEASE EXAMPLE on FIDDLE CLICK HERE</a></p> <pre><code>&lt;script&gt; $(function() { var today = new Date(); var tomorrow = new Date(); tomorrow.setDate(today.getDate() + 1); $( "#from" ).datetimepicker({ dateFormat: "dd-mm-yy", defaultDate: "+1w", changeMonth: true, numberOfMonths: 2, minDate: -0, maxDate: "+2w", onClose: function( selectedDate ) { $( "#to" ).datepicker( "option", "minDate", selectedDate ); } }); $( "#to" ).datetimepicker({ dateFormat: "dd-mm-yy", defaultDate: "+1w", changeMonth: true, numberOfMonths: 2, minDate: 0, maxDate: "+2w", onClose: function( selectedDate ) { $( "#from" ).datepicker( "option", "maxDate", selectedDate ); } }); }); &lt;/script&gt; </code></pre> <p>Fields below</p> <pre><code>&lt;input style="text-transform:none;" class="button_date" type="text" value="&lt;?php echo $_REQUEST['from']; ?&gt;" size="15" id="from" name="from" readonly /&gt; &lt;input style="text-transform:none;" class="button_date" size="15" type="text" value="&lt;?php echo $_REQUEST['to']; ?&gt;" id="to" name="to" readonly /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload