mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
add online locations and geo coords to ics export
This commit is contained in:
parent
1f0ae33e83
commit
6d034f18d9
1 changed files with 7 additions and 2 deletions
|
@ -100,6 +100,7 @@ const exportController = {
|
|||
const tmpStart = DateTime.fromSeconds(e.start_datetime, { zone: 'UTC' })
|
||||
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 = {
|
||||
uid: `${e.id}@${settings.hostname}`,
|
||||
start,
|
||||
|
@ -107,14 +108,18 @@ const exportController = {
|
|||
endInputType: 'utc',
|
||||
title: `[${settings.title}] ${e.title}`,
|
||||
description: htmlToText(e.description),
|
||||
htmlContent: e.description.replaceAll("\n","\n\t"),
|
||||
location: `${e.place.name} - ${e.place.address}`,
|
||||
htmlContent: e.description.replaceAll("\n","<br>"),
|
||||
location,
|
||||
url: `${settings.baseurl}/event/${e.slug || e.id}`,
|
||||
status: 'CONFIRMED',
|
||||
categories: e.tags.map(t => t.tag),
|
||||
alarms
|
||||
}
|
||||
|
||||
if (e.place.latitude && e.place.longitude) {
|
||||
ret.geo = { lat: e.place.latitude, lon: e.place.longitude }
|
||||
}
|
||||
|
||||
if (e.end_datetime) {
|
||||
const tmpEnd = DateTime.fromSeconds(e.end_datetime, { zone: 'UTC' })
|
||||
const end = [ tmpEnd.year, tmpEnd.month, tmpEnd.day, tmpEnd.hour, tmpEnd.minute ]
|
||||
|
|
Loading…
Reference in a new issue