Сообщение от savsoft
|
и 30
|
<script>
let dateFormat = d => d.toLocaleDateString("ru");
function getDates(date)
{ var arr = [];
date = new Date(date);
if(!date) return arr;
var days = 7;
date.setDate(date.getDate() + days);
var month = date.getMonth();
while (date.getMonth() == month) {
arr.push(dateFormat(date))
date.setDate(date.getDate() + days);
}
return arr;
}
document.write(getDates(new Date(2020, 2, 3).getTime()))
</script>