jQuery datetimepicker set end date when start is given
<p>How I can change the end date when the user selects the start time? I want to disable the days before the start time. It's homework, but I am new to jquery.</p>

<p>Thanks. Here is the code i managed to work, but i don't know what to change.</p>

<pre><code>   &lt;script&gt;
        $(document).ready(function() {
          $('#start').val(moment(start).format('YYYY-MM-DD'));
          $('#end').val(moment().add(+1, 'days').format('YYYY-MM-DD'));
          $("#checkAll").click(function () {
            $('input:checkbox').not(this).prop('checked', this.checked);
          });
          $("#checkAllEdit").click(function () {
            $('input:checkbox').not(this).prop('checked', this.checked);
          });

          $("#start, #end").datepicker('setDate', new Date());
          $("#start, #end").datepicker({
            dateFormat: 'yy-mm-dd'
          });
        });
    &lt;/script&gt;
</code></pre>

<p>THE WORKING VERSION:</p>

<pre><code>          $('body').on('focus', ".dpicker", function () {
            $(this).datepicker();
          });

          $(function () {
            $("#start").datepicker({
              minDate: 1,
              changeMonth: true,
              dateFormat: 'yy-mm-dd',
              onClose: function (selectedDate, instance) {
                if (selectedDate != '') {
                  $("#end").datepicker("option", "minDate", selectedDate);
                  var date = $.datepicker.parseDate(instance.settings.dateFormat, selectedDate, instance.settings);
                  date.setMonth(date.getMonth() + 3);
                  var minDate2 = new Date(selectedDate);
                  minDate2.setDate(minDate2.getDate() + 1);

                  $("#end").datepicker("option", "minDate", minDate2);
                  $("#end").datepicker("option", "maxDate", date);
                }
              }
            });
            $("#end").datepicker({
              minDate: 1,
              changeMonth: true,
              dateFormat: 'yy-mm-dd',
              onClose: function (selectedDate) {
                $("#star").datepicker("option", "maxDate", selectedDate);
              }
            });


          });
</code></pre>