diff --git a/PC2/Views/Events/Index.cshtml b/PC2/Views/Events/Index.cshtml index 43a1f17..d970884 100644 --- a/PC2/Views/Events/Index.cshtml +++ b/PC2/Views/Events/Index.cshtml @@ -1,4 +1,4 @@ -@model PC2.Models.EventsModel +@model PC2.Models.EventsModel @{ ViewData["Title"] = "Event Calendar"; @@ -25,10 +25,12 @@ .pc2-event { background-color: #d1e7dd !important; /* Light green */ + color: #212529 !important; } .county-event { background-color: #f8d7da !important; /* Light red */ + color: #212529 !important; } .legend { @@ -47,7 +49,7 @@ margin-right: 10px; } - /* CSS to word break on multiple lines in the event modal dialog */ + /* CSS to word break on multiple lines in the event modal dialog */ #modalEventTitle { overflow-wrap: anywhere; } @@ -75,94 +77,119 @@ - - - - + + + }, + eventClick: function(info) { + var startTime = info.event.start.toLocaleString(); + var endTime = info.event.end ? info.event.end.toLocaleString() : 'N/A'; + + document.getElementById('modalEventTitle').innerHTML = info.event.title; + document.getElementById('modalEventDate').innerText = startTime; + document.getElementById('modalEventEndTime').innerText = endTime; + + new bootstrap.Modal(document.getElementById('eventModal')).show(); + }, + validRange: function(currentDate) { + // Today's date + const start = new Date(currentDate); + + // Sets end to 1 year in future based on today's date + const end = new Date(currentDate); + end.setMonth(end.getMonth() + 12); + + return { start, end }; + }, + eventDidMount: function(info) { + // Render HTML in event titles instead of escaped text. + // List view: write to the