jquery – populate events for FullCalendar 5 with a Json URL in .NET Core
I want to populate events for a FullCalendar 5 with a Json URL in .NET Core
Here’s the initialization of the calendar :
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
//themeSystem: 'bootstrap5',
//plugins: [ timeGridPlugin ],
initialView: 'timeGridWeek',
selectable: true,
selectOverlap: false,
headerToolbar: {
left: 'prevYear,prev,next,nextYear today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,dayGridDay'
},
buttonText: {
today: 'Aujourdhui',
month: 'mois',
week: 'semaine',
timeGridWeek: 'jour',
day: 'jour',
list: 'liste'
},
initialDate: '2020-09-12',
navLinks: true, // can click day/week names to navigate views
editable: true,
dayMaxEvents: true, // allow "more" link when too many events
events:'@Url.Action("ListeAnnoncesJSON","Vendeur")'
Here’s the URL “ListeAnnoncesJSON” :
{"sr":1,"title":"exemple","desc":"azazazaza","start":"2022-06-06T12:30:00","end":"2022-06-10T12:30:00"}
There’s no data in the calendar.
If somebody can help me please
Thanks,
Read more here: Source link