Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.jensbits.com/2009/12/03/using-jquery-datepicker-and-dialog-box-to-select-date-range/" rel="nofollow noreferrer">Example of dialog with datepicker inside</a> </p> <p><strong>Edit after code posted in question</strong></p> <p>The re-initializing of the datepicker again and again is causing it to error. </p> <p>First initialized here:</p> <pre><code>$expire_date = $("#expire_date").datepicker(datepickerOptions), </code></pre> <p>then here</p> <pre><code>$expire_date.datepicker("setDate", "+7"); </code></pre> <p>and here:</p> <pre><code>var $dates = $("#start_date, #expire_date").datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 3, onSelect: function (selectedDate) { var option = this.id == "start_date" ? "minDate" : "maxDate"; $dates.not(this).datepicker("option", option, selectedDate); } }); </code></pre> <p>See <a href="https://stackoverflow.com/questions/1274347/problem-with-jquery-datepicker-onselect">problem with jquery datepicker onselect</a> to see how to set options and the onSelect event after initializing the datepicker. </p> <p>It looks like all you <strong>may</strong> have to update is this:</p> <pre><code>var $dates = $("#start_date, #expire_date").datepicker('option', { onSelect: function(selectedDate) { var option = this.id == "start_date" ? "minDate" : "maxDate"; $dates.not(this).datepicker("option", option, selectedDate); } }, { defaultDate: '+1w' }, { changeMonth: true }, { numberOfMonths: '3' }); </code></pre> <p>Fiddle example: <a href="http://jsfiddle.net/az25g/" rel="nofollow noreferrer">http://jsfiddle.net/az25g/</a></p>
    singulars
    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