arshaw/fullcalendar — pull request #38 by joeyespo (2011-12-05 16:04:31+00:00)
Title: Added the 'eventTransform' option to allow event transformations

...coming from a JSON event source.

This allows you to continue using JSON feeds even when you don't have direct control over the incoming data and without manually using a function, which comes with some overhead and additional assumptions.

A transform is also useful to further separate your design concerns. In particular, you can now specify a data schema for the JSON feed that more closely matches your project's high level-data model. FullCalendar will fetch this data, then using the transform, put it into a form FullCalendar accepts with much more clarity.

Example usage:

events: 'my-calendar/events',
eventTransform: function(event) {
return {
id: event.id,
title: event.title,
start: event.startDate,
end: event.endDate,
url: event.action.url,
className: ['my-event', 'my-event-' + event.eventType],
eventType: event.eventType // Used in eventRender
};
},