Mr. W.
Mr. W.

Reputation: 359

Only show upcoming events in fullcalendar list view

I've got a simple FullCalendar setup, and I'd like to use a list view similar to Google's Agenda view, which is a list starting on the current date like so:

gcal

My current FullCalendar setup uses the listYear view, which starts at the beginning of the year and only shows the current year:

fc

How can I make a list view that:

FullCalendar code:

<script type='text/javascript'>
    $(document).ready(function() {
        $('#calendar').fullCalendar({
            defaultView: 'listYear',

            googleCalendarApiKey: 'xxxxxxxx',
            events: {
                googleCalendarId: '[email protected]'
            }
        });
    });
</script>

Upvotes: 0

Views: 3267

Answers (1)

Mr. W.
Mr. W.

Reputation: 359

Here's my solution:

<script type='text/javascript'>
    $(document).ready(function() {
        $('#calendar').fullCalendar({
            defaultView: 'list',
            header: false,

            views: {
                list: {
                    duration: { days: 90 },
                    listDayAltFormat: 'dddd',
                }
            },

            googleCalendarApiKey: 'xxxxxxxx',
            events: {
                googleCalendarId: '[email protected]'
            }
        });
    });
</script>

fc_fix

Upvotes: 2

Related Questions