1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

show events' location

This commit is contained in:
Daniel Waxweiler
2021-04-11 22:42:50 +02:00
parent 56d501464e
commit 233cdbf8fa
3 changed files with 31 additions and 2 deletions

View File

@@ -29,6 +29,26 @@ function displayEvents(data, list) {
const textnode = document.createTextNode(dateText)
li.appendChild(textnode)
if (events[i].physicalAddress) {
let location = ''
if (events[i].physicalAddress.description) {
location += events[i].physicalAddress.description
}
if (location && events[i].physicalAddress.locality) {
location += ', '
}
if (events[i].physicalAddress.locality) {
location += events[i].physicalAddress.locality
}
if (location) {
const brBeforeLocation = document.createElement('br')
li.appendChild(brBeforeLocation)
const textnodeLocation = document.createTextNode(location)
li.appendChild(textnodeLocation)
}
}
list.appendChild(li)
}
}