Process dates

This commit is contained in:
2021-04-21 17:49:47 +02:00
parent dac00ccf3a
commit 5fec0aa24c
3 changed files with 70 additions and 15 deletions

View File

@ -101,4 +101,22 @@ const ComunicDate = {
},
}
ComunicWeb.common.date = ComunicDate;
ComunicWeb.common.date = ComunicDate;
/**
* Get all the days of a specified range
*
* @param {Date} start
* @param {Date} end (exclusive)
*/
function getDaysOfRange(start, end) {
let curr = start;
let list = [];
while (curr < end) {
list.push(curr);
curr = new Date(curr.getTime() + 1000*60*60*24);
}
return list;
}