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
Post a Comment