OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to add any event in fullcalendar on click of button?

  • Thread starter Thread starter nirux
  • Start date Start date
N

nirux

Guest
I have added ('+') button on each day/ cells.

Code:
var add_button = '<input type="button" value="+" />'; 
$(".fc-day-number").prepend(add_button);

calendar with each cells having button to add event


How to add event after clicking on this ('+') button, able to do the same on click of any day by writing this:

Code:
dayClick: function(date) {
                addEvent(date);                 
            },

function addEvent(date) {
    var newEvent = {
    title: timeSlot,
    start: date.format()
    };
}

<p>I have added ('+') button on each day/ cells.</p>

<pre><code>var add_button = '<input type="button" value="+" />';
$(".fc-day-number").prepend(add_button);
</code></pre>

<p><img src="https://i.sstatic.net/GZ0ab.png" alt="calendar with each cells having button to add event"></p>

<p>How to add event after clicking on this ('+') button, able to do the same on click of any day by writing this:</p>

<pre><code>dayClick: function(date) {
addEvent(date);
},

function addEvent(date) {
var newEvent = {
title: timeSlot,
start: date.format()
};
}
</code></pre>
 

Latest posts

H
Replies
0
Views
1
hohohohoho
H
Top