_docs-v6/event-model/event-object.md
A JavaScript object that FullCalendar uses to store information about a calendar event. It is exposed in various places of the API such as getEventById and provides methods for dynamic manipulation. It was originally parsed from a plain object.
var calendar = new Calendar(calendarEl, {
timeZone: 'UTC',
events: [
{
id: 'a',
title: 'my event',
start: '2018-09-01'
}
]
})
var event = calendar.getEventById('a') // an event object!
var start = event.start // a property (a Date object)
console.log(start.toISOString()) // "2018-09-01T00:00:00.000Z"
An event object has a number of properties and methods. All properties are read-only and you must use the methods to modify the properties. Here is a list of all properties that exist on an event object:
<table> <tr> <th>id</th> <td markdown='1'> String. A unique identifier of an event. Useful for [getEventById](Calendar-getEventById). </td> </tr> <tr> <th>groupId</th> <td markdown='1'> String. Events that share a `groupId` will be dragged and resized together automatically. </td> </tr> <tr> <th>allDay</th> <td markdown='1'> Boolean (`true` or `false`). Determines if the event is shown in the "all-day" section of relevant views. In addition, if `true` the time text is not displayed with the event. </td> </tr> <tr> <th>start</th> <td markdown='1'> [Date object](date-object) that obeys the current [timeZone](timeZone). When an event begins. </td> </tr> <tr> <th>end</th> <td markdown='1'> [Date object](date-object) that obeys the current [timeZone](timeZone). When an event ends. It could be `null` if an end wasn't specified.Note: This value is exclusive. For example, an event with the end of 2018-09-03 will appear to span through 2018-09-02 but end before the start of 2018-09-03. See how events are are parsed from a plain object for further details.
All properties are read-only. If you want to modify them, use the various methods of the Event object, such as setProp, setExtendedProp, setDates, etc.
The expected values for allDay, start and end have been discussed in detail on the subject of parsing events. It is vital to understand how the end date is exclusive throughout the FullCalendar API.
In addition to the fields above, you may also include your own non-standard fields in each Event object. FullCalendar will not modify or delete these fields. For example, developers often include a description field for use in callbacks like event render hooks. Any non-standard properites are moved into the extendedProps hash during event parsing.
var calendar = new Calendar(calendarEl, {
events: [
{
title: 'BCH237',
start: '2019-08-12T10:30:00',
end: '2019-08-12T11:30:00',
extendedProps: {
department: 'BioChemistry'
},
description: 'Lecture'
}
// more events ...
],
eventDidMount: function(info) {
console.log(info.event.extendedProps);
// {description: "Lecture", department: "BioChemistry"}
}
});