1
0
mirror of https://github.com/bigchaindb/site.git synced 2024-11-21 17:26:55 +01:00

check for existing next meetup

This commit is contained in:
Matthias Kretschmann 2018-05-03 17:00:40 +02:00
parent 8025a20e7a
commit 267ce5ab5f
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -7,15 +7,23 @@ document.addEventListener('DOMContentLoaded', function() {
// just grab the first item of array
const nextEvent = events[0]
const name = nextEvent.name
const link = nextEvent.link
const date = new Date(nextEvent.time).toLocaleDateString('en-us', { month: 'short', day: 'numeric' })
const element = document.getElementsByClassName('js-social-link--meetup')[0]
const elementTitle = document.getElementsByClassName('meetup-title')[0]
elementTitle.innerHTML = '<span class="hero__community__label">' + date + '</span> ' + '<strong>' + name + '</strong>'
elementTitle.style.opacity = 1
element.href = link
if (nextEvent) {
const name = nextEvent.name
const link = nextEvent.link
const date = new Date(nextEvent.time).toLocaleDateString('en-us', {
month: 'short',
day: 'numeric'
})
const elementTitle = document.getElementsByClassName('meetup-title')[0]
elementTitle.innerHTML = `<span class="hero__community__label">${date}</span><strong>${name}</strong>`
elementTitle.style.opacity = 1
element.href = link
} else {
element.classList.add('hide')
}
}
fetch(url)