set ics output type to local, add plain description, status and categories

This commit is contained in:
lesion 2022-05-03 18:02:20 +02:00
parent 367df6a6a4
commit 3f4e5ae7a8
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -2,6 +2,7 @@ const Event = require('../models/event')
const Place = require('../models/place')
const Tag = require('../models/tag')
const { htmlToText } = require('html-to-text')
const { Op, literal } = require('sequelize')
const moment = require('dayjs')
const ics = require('ics')
@ -88,13 +89,16 @@ const exportController = {
const end = tmpEnd.utc(true).format('YYYY-M-D-H-m').split('-').map(Number)
return {
start,
// startOutputType: 'utc',
startOutputType: 'local',
end,
// endOutputType: 'utc',
endOutputType: 'local',
title: `[${settings.title}] ${e.title}`,
description: e.description,
description: htmlToText(e.description),
htmlContent: e.description,
location: `${e.place.name} - ${e.place.address}`,
url: `${settings.baseurl}/event/${e.slug || e.id}`,
status: 'CONFIRMED',
categories: e.tags,
alarms
}
})