Fullcalendar v5 remove all events on button click

I want to remove all events in fullcalendar v5 upon click of a button, the code below works fine

calendar.addEventSource([
    {
      title: 'Business Lunch',
      start: '2020-04-03T01:00:00',
    },
]);

But how can I able to remove/clear/delete all events after button click?
The older version of fullcalendar has this method

calendar.fullCalendar( 'removeEvents', []);

How about for v5? I tried the code below but it gives me an error remove is not a function. I even tried calendar.refetchEvents();but nothing works.

$('.button').click(function(event) {
    calendar.remove();
});

126 thoughts on “Fullcalendar v5 remove all events on button click”

  1. Right now it looks like BlogEngine is the top blogging platform available right now.
    (from what I’ve read) Is that what you’re using
    on your blog?

    Reply
  2. Hello, I think your blog might be having browser compatibility issues.
    When I look at your website in Firefox, it looks fine but when opening in Internet Explorer, it has some overlapping.

    I just wanted to give you a quick heads up! Other then that, awesome
    blog!

    Reply
  3. First off I would like to say awesome blog! I had a quick question in which I’d like to
    ask if you do not mind. I was curious to know
    how you center yourself and clear your mind before
    writing. I’ve had difficulty clearing my mind in getting my thoughts out there.
    I do enjoy writing but it just seems like the first 10 to 15
    minutes tend to be wasted simply just trying to
    figure out how to begin. Any suggestions or tips? Kudos!
    part time jobs hired in 30 minutes https://parttimejobshiredin30minutes.wildapricot.org/

    Reply
  4. Hello there! This is kind of off topic but I need some guidance from an established blog.
    Is it hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where to begin.
    Do you have any tips or suggestions? Thank you

    Reply
  5. Good day! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Many thanks!

    Reply
  6. Hello just wanted to give you a quick heads up.

    The words in your post seem to be running off the screen in Internet explorer.
    I’m not sure if this is a formatting issue or
    something to do with browser compatibility but I thought
    I’d post to let you know. The design look great though!

    Hope you get the problem solved soon. Many thanks

    Reply

Leave a Comment