javascript - How to use today & tomorrow button with bootstrap-datetime picker? -
i've made bootstrap-datetimepicker. need today & tomorrow button & layout should below. how can that?
html code:
<div class='col-md-6'> <label class=" text-info">depart</label> <div class="form-group"> <div class='input-group date' id='datetimepicker1' data-date-format="dd-mm-yyyy"> <input type='text' class="form-control" placeholder="dd-mm-yyyy" /> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <div class='col-md-6'> <label class=" text-info">return</label> <div class="form-group"> <div class='input-group date' id='datetimepicker2' data-date-format="dd-mm-yyyy"> <input type='text' class="form-control" placeholder="dd-mm-yyyy" /> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div>
javascript
$(function() { //depart & return date time picker $('#datetimepicker1').datetimepicker({ picktime: false, todaybtn: true }); $('#datetimepicker2').datetimepicker({ picktime: false }); });
you need below:
write event clicks on "today" , "tomorrow" selection update "month/day/day" displayed.
wire onselect event of datepicker, i.e when date selected use date selected update "month/day/day" displayed.
this way should able done.
Comments
Post a Comment