add online locations and geo coords to ics export
This commit is contained in:
@@ -100,6 +100,7 @@ const exportController = {
|
|||||||
const tmpStart = DateTime.fromSeconds(e.start_datetime, { zone: 'UTC' })
|
const tmpStart = DateTime.fromSeconds(e.start_datetime, { zone: 'UTC' })
|
||||||
const start = [ tmpStart.year, tmpStart.month, tmpStart.day, tmpStart.hour, tmpStart.minute ]
|
const start = [ tmpStart.year, tmpStart.month, tmpStart.day, tmpStart.hour, tmpStart.minute ]
|
||||||
|
|
||||||
|
const location = e.place.name !== 'online' ? `${e.place.name} - ${e.place.address}` : `${e.place.name} - ${e?.online_locations[0]}`
|
||||||
const ret = {
|
const ret = {
|
||||||
uid: `${e.id}@${settings.hostname}`,
|
uid: `${e.id}@${settings.hostname}`,
|
||||||
start,
|
start,
|
||||||
@@ -107,14 +108,18 @@ const exportController = {
|
|||||||
endInputType: 'utc',
|
endInputType: 'utc',
|
||||||
title: `[${settings.title}] ${e.title}`,
|
title: `[${settings.title}] ${e.title}`,
|
||||||
description: htmlToText(e.description),
|
description: htmlToText(e.description),
|
||||||
htmlContent: e.description.replaceAll("\n","\n\t"),
|
htmlContent: e.description.replaceAll("\n","<br>"),
|
||||||
location: `${e.place.name} - ${e.place.address}`,
|
location,
|
||||||
url: `${settings.baseurl}/event/${e.slug || e.id}`,
|
url: `${settings.baseurl}/event/${e.slug || e.id}`,
|
||||||
status: 'CONFIRMED',
|
status: 'CONFIRMED',
|
||||||
categories: e.tags.map(t => t.tag),
|
categories: e.tags.map(t => t.tag),
|
||||||
alarms
|
alarms
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.place.latitude && e.place.longitude) {
|
||||||
|
ret.geo = { lat: e.place.latitude, lon: e.place.longitude }
|
||||||
|
}
|
||||||
|
|
||||||
if (e.end_datetime) {
|
if (e.end_datetime) {
|
||||||
const tmpEnd = DateTime.fromSeconds(e.end_datetime, { zone: 'UTC' })
|
const tmpEnd = DateTime.fromSeconds(e.end_datetime, { zone: 'UTC' })
|
||||||
const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ]
|
const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ]
|
||||||
|
|||||||
Reference in New Issue
Block a user