I am trying to add dates to a slider and need to increment the values on click. I currently start with the year - 2
$('#adddates').click(function() {
var year = 2;
$("#slider").dateRangeSlider({
bounds: {
min: new Date(Today.getFullYear() - ++year, 0, 1),
max: new Date(Today.getFullYear(), Today.getMonth(), Today.getDate())
}
});
});
On click I am only getting an additional year. I need to increase the number of the year variable from 2 on each click. How can this be achieved?
++year. So can you clarify what you mean then by saying increase the number of the year variable from 2? Do you mean usingyear += 2?