Files

198 lines
4.5 KiB
Plaintext

Event Object
============
A standard JavaScript object that FullCalendar uses to store information about a calendar event.
Here are its properties:
<table>
<!-- ------------------- -->
<tr>
<th>
id
</th>
<td markdown='block'>
String/Integer. Optional
Uniquely identifies the given event. Different instances of repeating events should all have the same `id`.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
title
</th>
<td markdown='block'>
String. *Required*.
The text on an event's element
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
allDay
</th>
<td markdown='block'>
`true` or `false`. Optional.
Whether an event occurs at a specific time-of-day. This property affects whether an event's time is shown.
Also, in the agenda views, determines if it is displayed in the "all-day" section.
**Don't include quotes** around your `true`/`false`. This value is not a string!
When specifying Event Objects for `events` or `eventSources`,
omitting this property will make it inherit from
[allDayDefault](), which is normally `true`.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
start
</th>
<td markdown='block'>
Date. *Required*.
The date/time an event begins.
When specifying Event Objects for `events` or `eventSources`,
you may specify a string in IETF format (ex: "Wed, 18 Oct 2009 13:00:00 EST"),
a string in ISO8601 format (ex: "2009-11-05T13:15:30Z") or a UNIX timestamp.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
end
</th>
<td markdown='block'>
Date. Optional.
The date/time an event ends.
As with `start`, you may specify it in IETF, ISO8601, or UNIX timestamp format.
**If an event is all-day**...
the end date is inclusive. This means an event with `start` Nov 10 and
`end` Nov 12 will span 3 days on the calendar.
**If an event is NOT all-day**...
the end date is exclusive. This is only a gotcha when your `end` has time 00:00.
It means your event ends on midnight, and it will not span through the next day.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
url
</th>
<td markdown='block'>
String. Optional.
A URL that will be visited when this event is clicked by the user.
For more information on controlling this behavior, see the [eventClick](../mouse/eventClick) callback.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
className
</th>
<td markdown='block'>
String/Array. Optional.
A CSS class (or array of classes) that will be attached to this event's element.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
editable
</th>
<td markdown='block'>
`true` or `false`. Optional.
Overrides the master [editable](../event_ui/editable) option for this single event.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
source
</th>
<td markdown='block'>
[Event Source Object](). Automatically populated.
A reference to the event source that this event came from.
</td>
</tr>
<!-- ------------------- -->
<th colspan='2' id='color-options'>
New options have been added in version 1.5 to change an event's colors:
</th>
<!-- ------------------- -->
<tr>
<th>
color
</th>
<td markdown='block'>
Sets an event's background *and* border color just like
the calendar-wide [eventColor](../event_rendering/eventColor) option.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
backgroundColor
</th>
<td markdown='block'>
Sets an event's background color just like
the calendar-wide [eventBackgroundColor](../event_rendering/eventBackgroundColor) option.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
borderColor
</th>
<td markdown='block'>
Sets an event's border color just like the
the calendar-wide [eventBorderColor](../event_rendering/eventBorderColor) option.
</td>
</tr>
<!-- ------------------- -->
<tr>
<th>
textColor
</th>
<td markdown='block'>
Sets an event's text color just like
the calendar-wide [eventTextColor](../event_rendering/eventTextColor) option.
</td>
</tr>
</table>
Non-standard Fields
-------------------
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 such
as [eventRender](../event_rendering/eventRender).
<div class='version-info' markdown='1'>
Prior to version 1.3, the *end* date was always exclusive, even when *allDay* was set to *true*.
Prior to version 1.3, the *allDay* property did not exist. *showTime* was used instead.
It was set to *true* to show times and *false* to hide them.
The *className* and *source* properties did not exist prior to version 1.2.
</div>