TimelineDateMapper
Configs
2
Configs
2Dates
Gets/sets the current time resolution object, which contains a unit identifier and an increment count
{ unit, increment }. This value means minimal task duration you can create using UI.
For example when you drag create a task or drag & drop a task, if increment is 5 and unit is 'minute' that means that you can create tasks in 5 minute increments, or move it in 5 minute steps.
This value is taken from viewPreset timeResolution
config by default. When supplying a Number to the setter only the increment is changed and the unit value
remains untouched.
timeResolution : {
unit : 'minute', //Valid values are "millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year".
increment : 5
}
| Parameter | Type | Description |
|---|---|---|
increment | Number | The increment in the specified unit |
unit | DurationUnit | The time resolution unit |
Scheduled events
Set to true to snap to the current time resolution increment while interacting with scheduled events.
The time resolution increment is either determined by the currently applied view preset, or it can be overridden using timeResolution.
If you also want to snap to resources while dragging events, set the snapToResource config of the EventDrag feature to true.
Properties
5
Properties
5Class hierarchy
Dates
Gets/sets the current time resolution object, which contains a unit identifier and an increment count
{ unit, increment }. This value means minimal task duration you can create using UI.
For example when you drag create a task or drag & drop a task, if increment is 5 and unit is 'minute' that means that you can create tasks in 5 minute increments, or move it in 5 minute steps.
This value is taken from viewPreset timeResolution
config by default. When supplying a Number to the setter only the increment is changed and the unit value
remains untouched.
timeResolution : {
unit : 'minute', //Valid values are "millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year".
increment : 5
}
| Parameter | Type | Description |
|---|---|---|
increment | Number | The increment in the specified unit |
unit | DurationUnit | The time resolution unit |
Returns the center date of the currently visible timespan of scheduler.
Scheduled events
Set to true to snap to the current time resolution increment while interacting with scheduled events.
The time resolution increment is either determined by the currently applied view preset, or it can be overridden using timeResolution.
If you also want to snap to resources while dragging events, set the snapToResource config of the EventDrag feature to true.
Functions
6
Functions
6Dates
Gets the x or y coordinate relative to the scheduler element, or page coordinate (based on the 'local' flag) If the coordinate is not in the currently rendered view, -1 will be returned.
| Parameter | Type | Description |
|---|---|---|
date | Date | Number | the date to query for (or a date as ms) |
options | Boolean | Object |
|
options.local | Boolean |
|
the x or y position representing the date on the time axis
Gets the date for an X or Y coordinate, either local to the view element or the page based on the 3rd argument.
If the coordinate is not in the currently rendered view, null will be returned unless the allowOutOfRange
parameter is passed a true.
| Parameter | Type | Description |
|---|---|---|
coordinate | Number | The X or Y coordinate |
roundingMethod | floor | round | ceil | Rounding method to use. 'floor' to take the tick (lowest header in a time axis) start date, 'round' to round the value to nearest increment or 'ceil' to take the tick end date |
local | Boolean | true if the coordinate is local to the scheduler view element |
allowOutOfRange | Boolean | By default, this returns |
The Date corresponding to the X or Y coordinate
Gets the time for a DOM event such as 'mousemove' or 'click' regardless of the orientation of the time axis.
| Parameter | Type | Description |
|---|---|---|
e | Event | the Event instance |
roundingMethod | floor | round | ceil | Rounding method to use. 'floor' to take the tick (lowest header in a time axis) start date, 'round' to round the value to nearest increment or 'ceil' to take the tick end date |
allowOutOfRange | Boolean | By default, this returns |
The date corresponding to the EventObject's position along the orientation of the time axis.
Gets the date for an XY coordinate regardless of the orientation of the time axis.
| Parameter | Type | Description |
|---|---|---|
xy | Array | The page X and Y coordinates |
roundingMethod | floor | round | ceil | Rounding method to use. 'floor' to take the tick (lowest header in a time axis) start date, 'round' to round the value to nearest increment or 'ceil' to take the tick end date |
local | Boolean | true if the coordinate is local to the scheduler element |
allowOutOfRange | Boolean | By default, this returns |
the Date corresponding to the xy coordinate
Returns the distance in pixels for the time span in the view.
| Parameter | Type | Description |
|---|---|---|
startDate | Date | The start date of the span |
endDate | Date | The end date of the span |
The distance in pixels
Other
Gets the start and end dates for an element Region
| Parameter | Type | Description |
|---|---|---|
rect | Rectangle | The rectangle to map to start and end dates |
roundingMethod | floor | round | ceil | Rounding method to use. 'floor' to take the tick (lowest header in a time axis) start date, 'round' to round the value to nearest increment or 'ceil' to take the tick end date |
duration | Number | The duration in MS of the underlying event |
an object containing start/end properties