Methods
-
(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 posnumber the position of interest rangeStartTimeDate | string | number the lower bound of the time range of interest rangeEndTimeDate | string | number the upper bound of the time range of interest rangeWidthnumber 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" div>
Parameters:
Name Type Description startTimeDate | string | number the start time of interest endTimeDate | string | number the end time of interest rangeStartTimeDate | string | number the lower bound of the time range of interest rangeEndTimeDate | string | number the upper bound of the time range of interest rangeWidthnumber 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 timeDate | string | number the time point of interest, where rangeStartTime <= time <="rangeEndTime" td> => rangeStartTimeDate | string | number the lower bound of the time range of interest rangeEndTimeDate | string | number the upper bound of the time range of interest rangeWidthnumber the width of the time range of interest Returns:
the position of the time relative to the width of the time range.- Type
- number