Data Structure

Following section describes the Data Format expected by Web2Cal. Web2Cal accepts data in JSON Format. Click here to know more about JSON. Web2Cal renders grouped Events. Calendar automatically renders each group in a different color. Each group can be either hidden or displayed by clicking the check box in Quick Filter section. 

Any logical grouping can be applied to form groups. For Example:

In a Webmail Client - Groups can be "Calendars"
In a Health Club-Groups could be by Event Type or Club Name or By Trainers
In an Organization - Groups could represent employees

Group Object

Group = {

name: <String>   [required]-Name for the group

groupId: <number> [required]-Unique ID for this group

 color: {Color Object}[optional]-Specify the color, else Web2Cal will assign a color

 show: true|false[optional]-Hide events for this group on load

events: [

{Event Object} 

{Event Object}

{Event Object}

... ]

}

 

Event Object

Event={

startTime: <Date> <String yyyy-mm-dd hh:mm:ss> [required] *

endTime: <Date>  <String yyyy-mm-dd hh:mm:ss> [required] *

group: {Group Object} [required]1

eventId: < String / Number > [required]

allDay: <boolean> [optional]

eventName: <String> [optional]

eventDesc: <String> [optional]

personId: <String / Number> [optional]2

personName: personID: <String> [optional]2

}

Color Object

Color={

color: <String> [required] - Name to identify the color

css: <String> [required] - Css Class name for the color.

 

* These can be null, for workshift view. It enables you to display Person Name, even if he does not have any events.

1 When Event is passed to calendar after update or insert, this is required. During initial load, when Event is passed within a group, Group object within Event is optional.

2 Applies only to workshift view.  These attributes are necessary to group the events to an individual.


Implicit Attributes to an Event: 

These are attributes added by Web2cal to each event object.
Attribute Description
formattedStartTime The start time for the event in HH:MM AM/PM format. Format can be specified in Web2CalConstants.TIME_FORMAT="hh:mm tt"
formattedEndTime The end time for the event in HH:MM AM/PM format. Format can be specified in Web2CalConstants.TIME_FORMAT="hh:mm tt"
_formattedStartDate The Event start date in a format specified in Web2CalConstants.DATE_FORMAT="MM/d/yyyy".
_formattedEndDate The Event end date in a format specified in Web2CalConstants.DATE_FORMAT="MM/d/yyyy".