mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
more hacking
This commit is contained in:
18
lib/dateHelper.js
Normal file
18
lib/dateHelper.js
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user