Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery datepicker- 2 inputs From and To
    text
    copied!<p>I am using the Jquery datepicker plugin with this <a href="http://trentrichardson.com/examples/timepicker/" rel="nofollow">timepicker addon</a> in two input boxes, one for the "From" date and the second with the "To" date.</p> <p>When I set the first one, I want the second one to be one day after the date selected in the first,disabling all the dates earlier than the date selected in the "From" date</p> <p>If the "To" date is selected first, then the "From" date is set to the day before the "To" date.</p> <p>I have found some examples, but I don't know how to get the <strong>date with time</strong>.So,If I ,for example, select <strong>13</strong>/12/2010 <strong>15:50</strong> in the "From" date, the date in the "To" date is set to <strong>14</strong>/12/2010 <strong>15:50</strong> or at least to <strong>14</strong>/12/2010 <strong>00:00</strong>.</p> <p><em><strong></em> EDITED***</strong></p> <p>I've just found this <a href="http://jsbin.com/iyobi" rel="nofollow">piece of code</a> that works as I want , but without the timepicker addon. </p> <pre><code> $(function(){ $('#dateFrom').datepicker({ dateFormat: 'dd/mm/yy', onSelect: function(dateText, inst) { $('#dateTo').datepicker('option','minDate', new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)); } }); $('#dateTo').datepicker({ dateFormat: 'dd/mm/yy', onSelect: function(dateText, inst) { $('#dateFrom').datepicker('option','maxDate', new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)); } }); }); </code></pre> <p>Based on the above code, would it be possible to adapt it ,so that I can use it with the timepicker addon?</p> <p>Thanks beforehand</p>
 

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