jcadima
3/24/2017 - 3:10 PM

Bootstrap Date Picker

Bootstrap Date Picker

https://formden.com/blog/date-picker

HEADER:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!-- Bootstrap Date-Picker Plugin -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>



<!-- Text input-->
<div class="form-group col-md-12 col-xs-12">
  <label class="col-md-4 control-label" for="lastName">Shipment Date *</label>  
  <div class="col-md-8">
	  <input id="shipdate" name="shipdate" type="text" placeholder="100" class="form-control input-md" required="">   
  </div>
</div><!--formgroup-->





<script>
	
$( document ).ready(function() {
    console.log( "ready!" );
      var date_input=$('input[name="shipdate"]'); //our date input has the name "date"
      var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
      var options={
        format: 'mm/dd/yyyy',
        container: container,
        todayHighlight: true,
        autoclose: true,
      };
      date_input.datepicker(options);
});	
	
</script>