Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to display two/three months?

Is it possible to display two/three months?

like image 914
John Smith Avatar asked Oct 15 '22 02:10

John Smith


1 Answers

Even I wanted the same and did something like this.

<table width="100%" cellpadding="5" cellspacing="5"> <tr> <td> &nbsp; </td> <td> <input type="button" id="myprevbutton" value="&nbsp;&#9668;&nbsp;" />&nbsp; <input type="button" id="mynextbutton" value="&nbsp;&#9658;&nbsp;" />&nbsp; </td> <td> &nbsp; </td> </tr> <tr> <td width="33%"> <div id='calendar0'> </div> </td> <td width="33%"> <div id='calendar1'> </div> </td> <td width="33%"> <div id='calendar2'> </div> </td> </tr> </table>

and in JS

$(document).ready(function() {

    var date = new Date();

    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();

    $('#calendar0').fullCalendar({
    header: {
            left: '',
            center: 'title',
            right: ''
        },
    month:m-1,
    theme: true,
    });
    $('#calendar2').fullCalendar({
    header: {
            left: '',
            center: 'title',
            right: ''
        },
    month:m+1,
    theme: true,
    });
    $('#calendar1').fullCalendar({
        header: {
            left: '',
            center: 'title',
            right: ''
        }, 
    theme: true,
    editable: false,
    });

    $('#myprevbutton').click(function() {
        $('#calendar0').fullCalendar('prev');
        $('#calendar1').fullCalendar('prev');
        $('#calendar2').fullCalendar('prev');
    });
    $('#mynextbutton').click(function() {
        $('#calendar0').fullCalendar('next');
        $('#calendar1').fullCalendar('next');
        $('#calendar2').fullCalendar('next');
    });



});
like image 177
Geervani Avatar answered Oct 19 '22 11:10

Geervani