xdan / periodpicker

Empty repository for paid periodpicker version
14 stars 2 forks source link

Return selected period as array, containing all days in the period. #53

Closed Kristiansky closed 6 years ago

Kristiansky commented 7 years ago

I want the periodpicker to return every day from the selected period, but currently it returns only start and end day. This is frustrating. image Can you guide me how to select every day and put it in the array?

xdan commented 6 years ago

For example all dates between two dates

var startDate = new Date();
var endDate = (new Date()).setFullYear(2019);

var dates = [];
while (startDate < endDate) {
dates.push(startDate.toString())
startDate.setDate(startDate.getDate() + 1)
}
console.log(dates)