use new ics to fix uuid warning

This commit is contained in:
les 2021-07-27 16:30:35 +02:00
parent 91c4e6a82b
commit ff0bb19540
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -62,8 +62,8 @@ const exportController = {
const eventsMap = events.map(e => { const eventsMap = events.map(e => {
const tmpStart = moment.unix(e.start_datetime) const tmpStart = moment.unix(e.start_datetime)
const tmpEnd = moment.unix(e.end_datetime) const tmpEnd = moment.unix(e.end_datetime)
const start = tmpStart.utc(true).format('YYYY-M-D-H-m').split('-') const start = tmpStart.utc(true).format('YYYY-M-D-H-m').split('-').map(Number)
const end = tmpEnd.utc(true).format('YYYY-M-D-H-m').split('-') const end = tmpEnd.utc(true).format('YYYY-M-D-H-m').split('-').map(Number)
return { return {
start, start,
// startOutputType: 'utc', // startOutputType: 'utc',
@ -77,8 +77,12 @@ const exportController = {
} }
}) })
res.type('text/calendar; charset=UTF-8') res.type('text/calendar; charset=UTF-8')
const ret = ics.createEvents(eventsMap) ics.createEvents(eventsMap, (err, value) => {
res.send(ret.value) if (err) {
return res.status(401).send(err)
}
return res.send(value)
})
} }
} }