dateClick

Triggered when the user clicks on a date or a time.

function( dateClickInfo ) { }

In order for this handler to fire, you must load the interaction plugin. If you are using a build system:

import { Calendar } from 'fullcalendar';
import interactionPlugin from 'fullcalendar/interaction';
...
const calendar = new Calendar(calendarEl, {
  plugins: [ interactionPlugin ],
  ...
  dateClick: function(info) {
    alert('Clicked on: ' + info.dateStr);
    alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
    alert('Current view: ' + info.view.type);
    // change the day's background color just for fun
    info.dayEl.style.backgroundColor = 'red';
  }
});
...

Alternatively, you can use a global bundle:

<script src='https://cdn.jsdelivr.net/npm/fullcalendar@7.1.0/all/global.js'></script>
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@7.1.0/themes/monarch/global.js'></script>
<link href='https://cdn.jsdelivr.net/npm/fullcalendar@7.1.0/skeleton.css' rel='stylesheet' />
<link href='https://cdn.jsdelivr.net/npm/fullcalendar@7.1.0/themes/monarch/theme.css' rel='stylesheet' />
<link href='https://cdn.jsdelivr.net/npm/fullcalendar@7.1.0/themes/monarch/palettes/purple.css' rel='stylesheet' />
<script>
...
const calendar = new FullCalendar.Calendar(calendarEl, {
  // no plugin configuration required!
});
...
</script>

dateClickInfo is a plain object with the following properties:

date

a Date for the clicked day/time.

dateStr

An ISO8601 string representation of the date. Will have a time zone offset according to the calendar’s timeZone like 2018-09-01T12:30:00-05:00. If clicked on an all-day cell, won’t have a time part nor a time zone part, like 2018-09-01.

allDay

true or false whether the click happened on an all-day cell.

dayEl

An HTML element that represents the whole-day that was clicked on.

jsEvent

The native JavaScript event with low-level information such as click coordinates.

view

The current View Object.

resource

If the current view is a resource-view, the Resource Object that owns this date. Must be using one of the resource plugins.

List View#

The dateClick trigger is not fired when the user clicks a day heading in list view.

Resource Views#

For resource views, this handler will receive an additional Resource Object parameter. Example:

const calendar = new FullCalendar.Calendar(calendarEl, {

  dateClick: function(info) {
    alert('Date: ' + info.dateStr);
    alert('Resource ID: ' + info.resource.id);
  }

});

Resources are a premium feature.

See a demo of dateClick with resources.