mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
move rest into pages
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
import moment from 'moment'
|
||||
|
||||
export function getDays({ startDate, endDate }) {
|
||||
let currentDay = moment(startDate)
|
||||
const days = [dateFormat(currentDay)]
|
||||
|
||||
if (!endDate) {
|
||||
return days
|
||||
}
|
||||
|
||||
const end = moment(endDate)
|
||||
while (currentDay < end) {
|
||||
currentDay = currentDay.add(1, 'day')
|
||||
days.push(dateFormat(currentDay))
|
||||
}
|
||||
|
||||
return days
|
||||
}
|
||||
|
||||
export function dateFormat(date) {
|
||||
if (!date) {
|
||||
return null
|
||||
}
|
||||
return moment(date).format('YYYY-MM-DD')
|
||||
}
|
||||
Reference in New Issue
Block a user