Events scheduled to occur at an appointed time are represented in MindFusion.Scheduling for JavaScript by the Item class. Item comprises the information that should be defined for all schedule events. The startTime and endTime properties of an Item specify the time and duration of an event. The recurrence property lets you create recurrent events that occur repeatedly following some recurrence pattern. There are several descriptive properties that define additional information about an Item, such as priority, subject and details. The class also defines methods that support serialization in JSON and XML formats.
The following code creates a new item for a birthday celebration that takes the whole present day and searches for the correct location:
JavaScript Copy Code |
---|
var p = MindFusion.Scheduling; var date = p.DateTime.today(); // create a new item |
It is possible to associate resources with scheduled events via the resources, contacts, location and task properties of Item. These properties contain objects from the Resource, Contact, Location and Task classes respectively.
The appearance of items when viewed in the Calendar can be set through CSS styles, which let you define the color, alignment and style of various elements of the item visualization, fill, icon images, and so on.
The following code uses Item.cssClass to set the color of the item from an array as parsed from a JSON file:
JavaScript Copy Code |
---|
item.cssClass = styles[index].colour; |