Specifies a time resolution.
Namespace: MindFusion.Scheduling
File: Enum.js
JavaScript Copy Code |
---|
// enum |
Member name | Description | |
---|---|---|
Day |
Specifies days. |
|
Hour |
Specifies hours. |
|
Minute |
Specifies minutes. |
|
Month |
Specifies months. |
|
Second |
Specifies seconds. |
|
Week |
Specifies weeks. |
|
Year |
Specifies years. |
The TimeUnit enumeration is used by the TimelineSettings.unit property. The ResourceViewSettings.bottomTimelineSettings, ResourceViewSettings.middleTimelineSettings and ResourceViewSettings.topTimelineSettings are of type TimelineSettings.
The following code sets the time unit of the bottom timeline in a calendar to Days and the count of units between adjacent ticks to 3 (days). The code assumes you have initialized a <div> element with id “calendar” in a web page that references the JavaScript file, which contains this code:
JavaScript Copy Code |
---|
var p = MindFusion.Scheduling; // create a new instance of the calendar calendar = new p.Calendar(document.getElementById("calendar")); // set the view to ResourceView, which displays the distribution of resources over a period of time calendar.currentView = p.CalendarView.ResourceView; calendar.resourceViewSettings.bottomTimelineSettings.unit = p.TimeUnit.Days; calendar.resourceViewSettings.bottomTimelineSettings.unitCount = 3; |