Fullcalendar Get Selected Year Using Jquery Example




Now let's see example of how to get selected year using jquery in fullcalendar example. I will show you get selected year in fullcalendar. This article will give you how to get selected year using jquery in fullcalendar.

We will talk about fullcalendar get selected year. In this example, i will give you simple and easy example for get selected year in fullcalendar.


<!DOCTYPE html>



<title>Fullcalendar Get Selected Year Using Jquery Example</title>

<link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.min.css" rel="stylesheet"/>

<link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.print.css" rel="stylesheet" media="print"/>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" >

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.min.js"></script>



<div class="container">

<div class="row">

<div class="col-md-12 mt-5 mb-5">

<div id="calendar"></div>




<script type="text/javascript">


selectable: true,

select: function(start, end, jsEvent, view) {

var allDay = !start.hasTime() && !end.hasTime();

console.log(["Selected Year : " + moment(start).format('YYYY')]);

alert(["Selected Year : " + moment(start).format('YYYY')]);}





It will help you...