javascript - How to use today & tomorrow button with bootstrap-datetime picker? -


enter image description here

i've made bootstrap-datetimepicker. need today & tomorrow button & layout should below. how can that?

enter image description here

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:

  1. write event clicks on "today" , "tomorrow" selection update "month/day/day" displayed.

  2. wire onselect event of datepicker, i.e when date selected use date selected update "month/day/day" displayed.

this way should able done.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -