0

I'm using FullCalendar and I'm trying to display the calendar view automatically without click on the today button each time. For do this I've inserted in the initialization this stuff:

$(document).ready(function() 
{
    $('#calendar').fullCalendar({
        aspectRatio: 2.40,
        viewDisplay: 'month'
    })
});

But the calendar isn't displayed, I must click on today button, I want that the calendar is displayed automatically, without click on today button each time. How can I do this?

Tekken
  • 63
  • 1
  • 7
  • [Try this](http://stackoverflow.com/questions/8174744/how-to-set-full-calendar-to-a-specific-start-date-when-its-initialized-for-the) – Keppy Aug 24 '16 at 11:15
  • By default the calendar should automatically have the current date in view. Do you mean the Month/Week/Day view? – Ryan89 Aug 24 '16 at 12:41
  • @Keppy Nope I'm trying to display the calendar automatically without click on the `today` button, I actually tried this: `$('.fc-today-button').trigger('click');` but not working – Tekken Aug 24 '16 at 13:25
  • Instead of **viewDisplay** you probably want **[defaultView](http://fullcalendar.io/docs/views/defaultView/)** – smcd Aug 24 '16 at 13:45
  • @smcd I tried also defaultView, but I must click on `today` button for display the calendar days – Tekken Aug 24 '16 at 14:06
  • What version of jquery, momentjs, fullcalendar? Using the latest and your code snippet above, unable to replicate issue @ https://jsfiddle.net/pqhtyt8j/ – smcd Aug 24 '16 at 14:09
  • @smcd I'm using the latest version, maybe 'cause I added the calendar inside a popup? – Tekken Aug 24 '16 at 14:23
  • @Tekken It maybe related to the popup. Jui dialog? Something else? I confirmed the calendar doesn't display fully if initialized before showing it in a jui dialog. You could force a **[render](http://fullcalendar.io/docs/display/render/)** when opening the dialog. https://jsfiddle.net/pqhtyt8j/2/ – smcd Aug 24 '16 at 17:27

1 Answers1

0

The "viewDisplay" parameter should be used in this way: http://fullcalendar.io/docs1/removed/viewDisplay/

Keep in mind the following comment: "This option has been deprecated in favor of the viewRender callback."

Seba
  • 95
  • 1
  • 10