time-ranges.js
- Source:
- utils/time-ranges.js
Methods
-
<inner> createTimeRangesObj( [ranges])
-
Create a time range object givent ranges of time.
Parameters:
Name Type Argument Description rangesArray <optional>
An array of time ranges.
- Source:
- utils/time-ranges.js
-
<inner> getRange(fnName, valueIndex, ranges [, rangeIndex])
-
Check if any of the time ranges are over the maximum index.
Parameters:
Name Type Argument Default Description fnNamestring The function name to use for logging
valueIndexstring The proprety that should be used to get the time. should be 'start' or 'end'
rangesArray An array of time ranges
rangeIndexArray <optional>
0 The index to start the search at
- Source:
- utils/time-ranges.js
Throws:
-
if rangeIndex is more than the length of ranges
- Type
- Error
Returns:
The time that offset at the specified index.
- Type
- number
-
<inner> rangeCheck(fnName, index, maxIndex)
-
Check if any of the time ranges are over the maximum index.
Parameters:
Name Type Description fnNamestring The function name to use for logging
indexnumber The index to check
maxIndexnumber The maximum possible index
- Source:
- utils/time-ranges.js
Throws:
-
if the timeRanges provided are over the maxIndex
- Type
- Error
-
<inner> time-ranges:indexFunction( [index])
-
Returns the time for the specified index at the start or end of a TimeRange object.
Parameters:
Name Type Argument Default Description indexnumber <optional>
0 The range number to return the time for.
- Source:
- utils/time-ranges.js
Returns:
The time that offset at the specified index.
- Type
- number
Type Definitions
-
TimeRange
-
An object that contains ranges of time for various reasons.
Type:
- Object
- Source:
- utils/time-ranges.js
- See:
Properties:
Name Type Description lengthnumber The number of time ranges represented by this Object
starttime-ranges:indexFunction Returns the time offset at which a specified time range begins.
endtime-ranges:indexFunction Returns the time offset at which a specified time range begins.