date-picker is not working

I am currently referring to this example. i already downloaded everything but my jquery is not working .

My html code is

   <div class="control-group">
    <label class="control-label" for="input17">Date:</label>                                                         
    <div class="controls">
    <input name="date" id="date" type="text" class="input-medium" placeholder="Date">
    <a class="btn" href="#"><i class="fa fa-calendar"></i></a>                                                             
    <div id="error_date"></div>                              
    </div>
    </div>

my Jquery is this.

     var nowTemp = new Date();
var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

var checkin = $('#date').datepicker({
  onRender: function(date) {
    return date.valueOf() < now.valueOf() ? 'disabled' : '';
  }
}).on('changeDate', function(ev) {
  if (ev.date.valueOf() > checkout.date.valueOf()) {
    var newDate = new Date(ev.date)
    newDate.setDate(newDate.getDate() + 1);
    checkout.setValue(newDate);
  }
  checkin.hide();

}).on('changeDate', function(ev) {
  checkout.hide();
}).data('datepicker');

please help.


Source: jquery

Leave a Reply