-
(static) getDate(pos, rangeStartTime, rangeEndTime, rangeWidth) : {number}
-
Calculates the date/time of a given position point relative to the width of a given time range.
Parameters:
| Name |
Type |
Description |
pos |
number
|
the position of interest
|
rangeStartTime |
Date
|
string
|
number
|
the lower bound of the time range of interest
|
rangeEndTime |
Date
|
string
|
number
|
the upper bound of the time range of interest
|
rangeWidth |
number
|
the width of the time range of interest
|
Returns:
the date in milliseconds since midnight Jan 1 1970 corresponding to the provided position and time range width.
-
Type
-
number
-
(static) getLength(startTime, endTime, rangeStartTime, rangeEndTime, rangeWidth) : {number}
-
Calculates the distance between two time points relative to the width of a given time range, e.g.
useful for calculating the length of a task bar given the start and end time, and the time axis range and width.
Expects rangeStartTime <= startTime <= endTime <= rangeEndTime.
Parameters:
| Name |
Type |
Description |
startTime |
Date
|
string
|
number
|
the start time of interest
|
endTime |
Date
|
string
|
number
|
the end time of interest
|
rangeStartTime |
Date
|
string
|
number
|
the lower bound of the time range of interest
|
rangeEndTime |
Date
|
string
|
number
|
the upper bound of the time range of interest
|
rangeWidth |
number
|
the width of the time range of interest
|
Returns:
the distance between the startTime and endTime positions relative to the width of the time range.
-
Type
-
number
-
(static) getPosition(time, rangeStartTime, rangeEndTime, rangeWidth) : {number}
-
Calculates the position of a given time point relative to the width of a given time range, e.g.
useful for calculating the start position of a task bar based on its start time and the given time axis range and width.
Parameters:
| Name |
Type |
Description |
time |
Date
|
string
|
number
|
the time point of interest, where rangeStartTime <= time <= rangeEndTime
|
rangeStartTime |
Date
|
string
|
number
|
the lower bound of the time range of interest
|
rangeEndTime |
Date
|
string
|
number
|
the upper bound of the time range of interest
|
rangeWidth |
number
|
the width of the time range of interest
|
Returns:
the position of the time relative to the width of the time range.
-
Type
-
number