1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-06-05 22:09:25 +02:00

add fallback time for unknown start date

This commit is contained in:
Ondřej Synáček
2019-12-15 10:56:26 +01:00
parent 946d1957dd
commit 0f5c9cf59c
2 changed files with 7 additions and 10 deletions

View File

@ -3,7 +3,9 @@ const dayjs = require('dayjs')
const { parseDates } = require('../parser-utils')
const parseEventData = (eventData) => {
const startDate = eventData.startDate && dayjs(eventData.startDate)
const startDate = eventData.startDate ?
dayjs(eventData.startDate) :
dayjs(new Date())
const endDate = eventData.endDate && dayjs(eventData.endDate)
const { start, duration } = parseDates(startDate, endDate)
const { location } = eventData || {}