more hacking

This commit is contained in:
Thomas Ruoff
2020-07-26 00:12:51 +02:00
parent 90a9288e84
commit 518b437d14
13 changed files with 166 additions and 54 deletions

18
lib/dateHelper.js Normal file
View File

@@ -0,0 +1,18 @@
import moment from 'moment'
export function getDays({ startDate, endDate }) {
let currentDay = moment(startDate)
const days = [currentDay.format('YYYY-MM-DD')]
if (!endDate) {
return days
}
const end = moment(endDate)
while (currentDay < end) {
currentDay = currentDay.add(1, 'day')
days.push(currentDay.format('YYYY-MM-DD'))
}
return days
}