3

I want to capture the event when the date number of a cell is clicked. I can't get dateClick to fire.

eventClick and select does not capture the event either

var calendarEl = document.getElementById('calendar');

calendar = new FullCalendar.Calendar(calendarEl, {
      plugins: ['dayGrid', 'timeGrid', 'list', 'interaction'],
      // should work according to docs.
      dateClick: function(info) {
        console.log(info.date.toISOString());
      },
      // old api for FullCalendar3
      dayClick: function(info) {
        console.log(info.date.toISOString());
      },
      // attempt to guess the interface
      dateSelect: function(info) {
        console.log(info.date.toISOString());
      },
ADyson
  • 57,178
  • 14
  • 51
  • 63
Liaoo
  • 425
  • 6
  • 21
  • 1
    You need to read https://fullcalendar.io/docs/date-nav-links – ADyson Aug 05 '19 at 13:08
  • got it. thanks! what is day click for then? – Liaoo Aug 06 '19 at 02:36
  • There's no such callback as dayClick anymore. There used to be, in version 3. In version 4 it's renamed as dateClick, which is used to detect clicks on the empty part of the day (i.e. any area not covered by events or by the day number). – ADyson Aug 06 '19 at 06:12
  • oops, i meant dateClick. Alright. Thanks for helping! – Liaoo Aug 06 '19 at 07:45

0 Answers0