mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
optionally display the current offset as short name after the time via the general plugin settings
This commit is contained in:
@@ -5,6 +5,7 @@ export function displayEvents({ data, document, list }) {
|
||||
const locale = list.getAttribute('data-locale')
|
||||
const maxEventsCount = list.getAttribute('data-maximum')
|
||||
const timeZone = list.getAttribute('data-time-zone')
|
||||
const isShortOffsetNameShown = list.hasAttribute('data-is-short-offset-name-shown')
|
||||
const events = data.events ? data.events.elements : data.group.organizedEvents.elements
|
||||
const eventsCount = Math.min(maxEventsCount, events.length)
|
||||
for (let i = 0; i < eventsCount; i++) {
|
||||
@@ -16,7 +17,13 @@ export function displayEvents({ data, document, list }) {
|
||||
const br = document.createElement('br')
|
||||
li.appendChild(br)
|
||||
|
||||
const date = Formatter.formatDate({ locale, start: events[i].beginsOn, end: events[i].endsOn, timeZone })
|
||||
const date = Formatter.formatDate({
|
||||
locale,
|
||||
start: events[i].beginsOn,
|
||||
end: events[i].endsOn,
|
||||
timeZone,
|
||||
isShortOffsetNameShown,
|
||||
})
|
||||
const textnode = document.createTextNode(date)
|
||||
li.appendChild(textnode)
|
||||
|
||||
|
Reference in New Issue
Block a user