mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 20:35:16 +00:00
Process dates
This commit is contained in:
@ -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;
|
||||
}
|
Reference in New Issue
Block a user