Fullcalendar v5 – how to call already initialised and rendered calendar

I have an initialised calendar:

   var calendarEl = document.getElementById("calendar");
   var calendar = new FullCalendar.Calendar(calendarEl, {

And a datepicker that when clicked on redirects to a different part of the code:

         onSelect: function(dateText) {
              resultado('mensaje', 'procesos.php?ac=10&v=D&fecha=' + dateText)

In that part of the code I used to be able to get the date picked and call the already rendered calendar to change its displayed date and view like this:

var ndate = new Date(//date conversion);
    $('#calendar').fullCalendar('gotoDate', ndate);
    $('#calendar').fullCalendar('changeView', 'agendaDay');

After upgrading to v5 I can’t seem to replicate this. I have read every page of docs in FullCalendar and I have tried different versions of this with no luck:


Does anyone know how to replace .fullCalendar or have any suggestions on what else to try? Thanks a lot!

Source: Ask PHP