Skip to content
Events
Welcome to Softwire’s Event Calendar!
Whether we’re hosting, attending, or sponsoring an event, our event calendar is designed to keep you informed so you don’t miss out on attending the latest event or viewing the highlights.
View our upcoming and past events below.
' + info.timeText + '
' + info.event.title + '
';
return {
html: htmlContent
};
},
eventMouseEnter: function(info) {
displayEventPopup(info);
var popup = document.querySelector('.c-event_popover__container');
elementsOverlap(popup);
},
eventMouseLeave: function(info) {
setTimeout(() => {
info.el.previousSibling.remove();
}, 3000);
},
datesSet: function(dateInfo) {
checkView(true);
document.querySelector('#mobEventDayList').innerHTML = '';
filterEvents();
},
eventClick: function(info) {
var chosenDay = info.event.start;
var day = chosenDay.getDate();
var month = new Intl.DateTimeFormat('en-GB', {month: 'long'}).format(chosenDay);
var year = chosenDay.getFullYear();
var dateTitle = month + ' ' + day + ' ' + year;
showListEvents(chosenDay, chosenDay, dateTitle );
}
});
calendar.render();
function checkView(filter=true) {
var view = calendar.view;
var resultsLabel = document.querySelector('.fc-toolbar-results');
if(resultsLabel) {
resultsLabel.remove();
}
document.querySelector('.fc-toolbar-title').style.display = 'block';
document.querySelector('.fc-prev-button').style.display = 'block';
document.querySelector('.fc-next-button').style.display = 'block';
if(view.type == 'listMonth') {
document.querySelector('.fc-list').innerHTML = '';
var start = calendar.view.activeStart;
var end = calendar.view.activeEnd;
var month = new Intl.DateTimeFormat('en-GB', {month: 'long'}).format(start);
var year = start.getFullYear();
dateTitle = month + ' ' + year;
showListEvents(start, end, dateTitle, filter);
} else if(view.type == 'listWeek') {
document.querySelector('.fc-list').innerHTML = '';
var start = calendar.view.activeStart;
var end = calendar.view.activeEnd;
var month = new Intl.DateTimeFormat('en-GB', {month: 'long'}).format(end);
var year = start.getFullYear();
dateTitle = month + ' ' + year;
showListEvents(start, end, dateTitle, filter, true);
}
}
function showableEventsCount() {
var numEvents = 0;
var currentEvents = calendar.getEvents();
var start = new Date();
currentEvents.forEach(evnt => {
if (evnt.end >= start) {
numEvents++;
}
});
return numEvents;
}
function showListEvents(start, end, dateTitle, filter=false, pastEvents = false) {
var currentEvents = calendar.getEvents();
//console.log(calendar.getEvents());
var eventListHTML = '
';
var eventsHTML = '';
var newEvents = currentEvents.sort((a, b) => a.start - b.start);
if(filter && !!pastEvents === false) {
start = new Date();
}
if(!!pastEvents) {
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
yesterday.setHours(23,59,0,0);
end = yesterday;
const pastDate = new Date();
pastDate.setFullYear(pastDate.getFullYear() - 5);
pastDate.setHours(00,01,0,0);
start = pastDate;
newEvents = newEvents.reverse();
}
var numEventsDisplayed = 0;
newEvents = newEvents.reverse();
newEvents.forEach(evnt => {
if(filter) {
if (evnt.display != 'none') {
var evnt_month = new Intl.DateTimeFormat('en-GB', {month: 'long'}).format(evnt.start);
var evnt_year = new Intl.DateTimeFormat('en-GB', {year: 'numeric'}).format(evnt.start);
var evnt_date = evnt_month + ' ' + evnt_year;
if(evnt_date != date) {
eventsHTML +='
' + evnt_date + '
';
date = evnt_date;
}
eventsHTML += eventListFormat(evnt);
numEventsDisplayed++;
}
} else if(evnt.display != 'none') {
eventsHTML += eventListFormat(evnt);
numEventsDisplayed++;
}
});
/*
if(start == end) {
var startDate = new Date(start).setHours(00, 00, 00);
var endDate = new Date(start).setHours(23, 59, 59);
newEvents.forEach(evnt => {
if(filter) {
if (evnt.end >= startDate && evnt.display != 'none') {
var evnt_month = new Intl.DateTimeFormat('en-GB', {month: 'long'}).format(evnt.start);
var evnt_year = new Intl.DateTimeFormat('en-GB', {year: 'numeric'}).format(evnt.start);
var evnt_date = evnt_month + ' ' + evnt_year;
if(evnt_date != date) {
eventsHTML +='
' + evnt_date + '
';
date = evnt_date;
}
eventsHTML += eventListFormat(evnt);
numEventsDisplayed++;
}
} else if(evnt.start <= endDate && evnt.end >= startDate && evnt.display != 'none') {
eventsHTML += eventListFormat(evnt);
numEventsDisplayed++;
}
});
} else {
newEvents.forEach(evnt => {
//if (evnt.start <= end && evnt.end >= start && evnt.display != 'none') {
if(filter) {
if ((!!pastEvents === false && evnt.end >= start && evnt.display != 'none') || (!!pastEvents === true && evnt.end <= end && evnt.display != 'none') ) {
var evnt_month = new Intl.DateTimeFormat('en-GB', {month: 'long'}).format(evnt.start);
var evnt_year = new Intl.DateTimeFormat('en-GB', {year: 'numeric'}).format(evnt.start);
var evnt_date = evnt_month + ' ' + evnt_year;
if(evnt_date != date) {
eventsHTML +='
' + evnt_date + '
';
date = evnt_date;
}
eventsHTML += eventListFormat(evnt, pastEvents);
numEventsDisplayed++;
}
} else if ((!!pastEvents === false && evnt.start <= end && evnt.end >= start && evnt.display != 'none') || (!!pastEvents === true && evnt.start >= start && evnt.end <= end && evnt.display != 'none')) {
eventsHTML += eventListFormat(evnt, pastEvents);
numEventsDisplayed++;
}
});
}
*/
if(filter) {
var date = '';
document.querySelector('.fc-toolbar-title').style.display = 'none';
document.querySelector('.fc-prev-button').style.display = 'none';
document.querySelector('.fc-next-button').style.display = 'none';
var showableEvents = showableEventsCount();
if(numEventsDisplayed == showableEvents) {
document.querySelector('.fc-toolbar-title').insertAdjacentHTML('beforebegin', '
');
} else {
document.querySelector('.fc-toolbar-title').insertAdjacentHTML('beforebegin', '
');
}
} else {
eventListHTML += '
' + dateTitle + '
';
}
if(eventsHTML == '') {
eventsHTML = '
No events
';
}
eventListHTML += eventsHTML;
eventListHTML += '
';
var view = calendar.view;
if(view.type == 'listMonth') {
document.querySelector('.fc-list').innerHTML = eventListHTML;
} else if(view.type == 'listWeek') {
document.querySelector('.fc-list').innerHTML = eventListHTML;
} else {
document.querySelector('#mobEventDayList').innerHTML = eventListHTML;
}
}
});
function displayEventPopup(info) {
hideOldPopups();
var html = '
';
html += '
';
html += '
';
html += info.event.extendedProps.popupDateTime;
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '' + info.event.title + '';
html += '
';
html += '
';
if(typeof info.event.extendedProps.popupEventLocation != 'undefined') {
html += '' + info.event.extendedProps.popupEventLocation + '';
}
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
info.el.insertAdjacentHTML('beforebegin', html);
}
function hideOldPopups() {
var popups = document.querySelectorAll('.c-event_popover__container');
if(popups.length) {
popups.forEach(popup => {
popup.style.visibility = 'hidden';
popup.remove();
});
}
}
function eventListFormat(event, pastEvent = false) {
var html = '
';
html += '
';
html += '
' + event.extendedProps.start_day + '
';
html += '
' + event.extendedProps.start_date + '
';
html += '
';
html += '
';
html += '
';
html += '
';
html += '';
html += '
' + event.title + '
';
html += '';
html += '';
if(typeof event.extendedProps.popupEventLocation != 'undefined' && event.extendedProps.popupEventLocation != '') {
html += '
';
html += '' + event.extendedProps.popupEventLocation + '';
if(!!pastEvent === false && typeof event.extendedProps.price != 'undefined' && event.extendedProps.price != '') {
html += ' | ' + event.extendedProps.price + '';
}
html += '
';
} else if(!!pastEvent === false && typeof event.extendedProps.price != 'undefined' && event.extendedProps.price != '') {
html += '
';
if(typeof event.extendedProps.price != 'undefined' && event.extendedProps.price != '') {
html += '' + event.extendedProps.price + '';
}
html += '
';
}
if(!!pastEvent === false) {
html += '
';
if(typeof event.extendedProps.times != 'undefined') {
html += '' + event.extendedProps.times + '';
}
html += '
';
}
html += '
';
if(typeof event.extendedProps.excerpt != 'undefined') {
html += event.extendedProps.excerpt;
}
html += '
';
html += '
';
html += '
';
html += '
';
html += '
';
if(typeof event.extendedProps.popupImg != 'undefined') {
html += '
';
html += '
';
html += '
';
}
if(typeof event.extendedProps.categoryName != 'undefined') {
html += '
';
html += '' + event.extendedProps.categoryName + '';
html += '
';
}
html += '
';
html += '
';
return html;
}
function elementsOverlap(el1) {
el2 = document.querySelector('#eventCalendar .fc-view-harness');
const domRect1 = el1.getBoundingClientRect();
const domRect2 = el2.getBoundingClientRect();
//console.log(domRect1);
//console.log(domRect2);
if(domRect1.top < domRect2.top) {
el1.classList.add('movedown');
}
if(domRect1.bottom > domRect2.bottom) {
//console.log('overlap bottom');
el1.classList.add('moveup');
}
if(domRect1.left < domRect2.left) {
//console.log('overlap left');
el1.classList.add('right');
}
if(domRect1.right > domRect2.right) {
//console.log('overlap right');
el1.classList.add('left');
}
}