I am stuck on blocking dates in bootstrap datepicker. I need it have a range of 7 days from the starting date and blocks all the dates which is not in the 7 days
for example the user chooses 11th April 2015. That user can only select dates until 18th April 2015 which would be the ending date. Can someone please help me.
Thanks.
Here is my code for the date picker bootstrap.
var nowDate = new Date(); var today = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), 0, 0, 0, 0); $('#startdate').datetimepicker({ minDate:today, format: 'YYYY-MM-DD HH:MM:SS' }).change(function (selected) { var startDate = new Date(selected.date.valueOf()); $('#enddate').datetimepicker('maxDate', startDate+10); });