function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nikhil kanth NayaniNikhil kanth Nayani 

how to implement functionality on fullcalendar js for each view

Hi all,

I am making use of fullcalendar js, I want to get the view name like 'month' when switching from week to month or 'agendaDay' when switching from week to day. Is there any method which fullcalendar is providing or any other way to get the value?

Thanks in advance
George Galaios 12George Galaios 12
Although it is too late, i post an answer so that maybe someone gets helped in the future...
So you can use "viewSkeletonRender" like the code below:
var calendar = new FullCalendar.Calendar(ele, {
      customButtons: {
        myCustomButton: {
          text: "custom!",
          click: function () {
            calendar.changeView("timeGridDay");
          }
        }
      },
      header: {
        left: "prev,next,today,myCustomButton",
        center: "title",
        right: "dayGridMonth,timeGridWeek,timeGridDay"
      },
      plugins: [
        "interaction",
        "resourceDayGrid",
        "resourceTimeGrid",
        "dayGrid",
        "timeGrid",
        "timeline",
        "interactionPlugin"
      ],
      events: this.eventsList,
      defaultView: "timeGridWeek",
      viewSkeletonRender: function (info) {
        alert("Change to type: " + info.view.type);
        this.queryTerm.value = info.view.type;
      }
    });
    calendar.render();
  }

 
Vshayari LINESVshayari LINES
reddit manreddit man
how to enable reddit dark mode  Reddit dark mode (https://alltecinfo.com/reddit-dark-mode/" target="_blank)