📌  相关文章
📜  如何在 React js 中获取范围内的所有日期 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:18.200000             🧑  作者: Mango

代码示例1
function (startDate, endDate, addFn, interval) {

 addFn = addFn || Date.prototype.addDays;
 interval = interval || 1;

 var retVal = [];
 var current = new Date(startDate);

 while (current <= endDate) {
  retVal.push(new Date(current));
  current = addFn.call(current, interval);
 }

 return retVal;

}