mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
use new ics to fix uuid warning
This commit is contained in:
parent
91c4e6a82b
commit
ff0bb19540
1 changed files with 8 additions and 4 deletions
|
@ -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)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue