How to get next date from selected date in Bootstrap Datepicker -


i have used bootstrap datepicker plugin

click here check plugin

i wanted know how next date selected date in date picker.

you need use .setdate() function in javascript set next day's date once have extracted selected date using getdate datepicker.


check working fiddle here : fiddle


javascript/jquery :

$('.datepicker').datepicker().on('changedate', function() {   var temp = $(this).datepicker('getdate');   var d = new date(temp);   $('#currentdate').html("the selected date :" + d);   d.setdate(d.getdate() + 1);   $('#tomorrowdate').html("the next date :" + d); }); 

html:

<div class="input-group date datepicker" data-provide="datepicker">   <input type="text" class="form-control">   <div class="input-group-addon">     <span class="glyphicon glyphicon-th"></span>   </div> </div> <div id="currentdate"> </div> <div id="tomorrowdate"> </div> 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -