I assume you are using this , so you can use endDate
and startDate
.
You need to install startDate
on Date.now - 6 months
and endDate
today.
var now = new Date();
var sixmonthsago = new Date(d.setMonth(d.getMonth() - 6));
$('.input-daterange').datepicker({
format: "mm/dd/yy",
orientation: "top left",
autoclose: true,
todayHighlight: false,
toggleActive: false,
endDate: now,
startDate: sixmonthsago
});
I have not tested the code.
user1399844
source
share