anchor.diff:    $('#from-date').on('dp.change', function (e) {
       $('#to-date').data('DateTimePicker').minDate(e.date)
     })
  +
     $('#to-date').on('dp.change', function (e) {
       $('#from-date').data('DateTimePicker').maxDate(e.date)
     })
  
positive.code: 
      <div role="tabpanel" class="tab-pane" id="dates">
  
          <div class='row'>
            <div class='col-md-12'>
              <div class='form-group col-md-6'>
                <label for='oldest' class='col-md-3 text-right'>From</label>
  
negative.code:   var format = 'YYYY-MM-DD HH:mm:ss'
    setEmbedCode()
    callFromToDatePicker(format, '<%= @from %>', '<%= @to %>', '<%= @earliest_date %>')
    callDatePicker(format, '<%= @to %>', '<%= @earliest_date %>')
  
    var picker = $('#boxcolour, #textcolour').colorpicker()
  
  