mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 01:36:55 +01:00
check for existing next meetup
This commit is contained in:
parent
8025a20e7a
commit
267ce5ab5f
@ -7,15 +7,23 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
|
|
||||||
// just grab the first item of array
|
// just grab the first item of array
|
||||||
const nextEvent = events[0]
|
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 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>'
|
if (nextEvent) {
|
||||||
elementTitle.style.opacity = 1
|
const name = nextEvent.name
|
||||||
element.href = link
|
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)
|
fetch(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user