2019-10-15 22:45:03 +02:00
|
|
|
const ics = require('ics')
|
|
|
|
|
|
|
|
const generateICS = async(data) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
2021-01-02 20:17:21 +01:00
|
|
|
ics.createEvent({
|
|
|
|
...data,
|
|
|
|
startInputType: 'utc',
|
|
|
|
endInputType: 'utc',
|
|
|
|
}, (err, value) => {
|
2019-10-15 22:45:03 +02:00
|
|
|
if (err) {
|
|
|
|
reject(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
resolve(value)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = generateICS
|