Navigate fullcalendar months using arrow keys on kayboard

In v3 of fullcalendar i could navigate months using a JavaScript switch statement with the following:

$('#calendar').fullCalendar('next');
$('#calendar').fullCalendar('prev');

I’ve now migrated to fullCalendar v6.15 and the js switch statement no longer works.

I have tried:

calendar.prev();
calendar.next();

Which won’t work, any suggestions in the right direction appreciated.