time-ranges.js
Methods
-
inner createTimeRangesObj(rangesopt)
-
Create a time range object givent ranges of time.
Parameters:
Name Type Attributes Description rangesArray <optional>
An array of time ranges.
-
inner getRange(fnName, valueIndex, ranges, rangeIndexopt) → {number}
-
Check if any of the time ranges are over the maximum index.
Parameters:
Name Type Attributes 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
Throws:
-
if rangeIndex is more than the length of ranges
- Type
- Error
Returns:
number -The time that offset at the specified index.
-
-
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
Throws:
-
if the timeRanges provided are over the maxIndex
- Type
- Error
-
-
inner time-ranges:indexFunction(indexopt) → {number}
-
Returns the time for the specified index at the start or end of a TimeRange object.
Parameters:
Name Type Attributes Default Description indexnumber <optional>
0 The range number to return the time for.
Returns:
number -The time that offset at the specified index.
Type Definitions
-
TimeRange
-
An object that contains ranges of time for various reasons.
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.