edit doc

Event::toPlainObject

Serializes an Event API Object to a plain object that would be fit for JSON.stringify.

event.toPlainObject( settings )

This methods attempts to aggregate all non-empty properties. Some properties are not yet supported, such as most recurrence propreties. If the resulting object does not look as desired, it is best to write your own serialization function from scratch.

The optional settings argument contains properties that affect serialization:

collapseExtendedProps If set to true, the extendedProps hash will be merged into the root outputted object. If false (the default), extendedProps will be its own object nested within the root object.
collapseColor If set to true, and the backgroundColor and borderColor properties are identical, they will be merged and outputted as a single color property. If false (the default), they will be outputted as separate properties.

The Event::toJSON method is aliased to Event::toPlainObject to make JSON.stringify work.