Module: time-ranges

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
ranges Array <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
fnName string

The function name to use for logging

valueIndex string

The proprety that should be used to get the time. should be 'start' or 'end'

ranges Array

An array of time ranges

rangeIndex Array <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
fnName string

The function name to use for logging

index number

The index to check

maxIndex number

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
index number <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
Properties:
Name Type Description
length number

The number of time ranges represented by this Object

start time-ranges:indexFunction

Returns the time offset at which a specified time range begins.

end time-ranges:indexFunction

Returns the time offset at which a specified time range begins.

Source:
utils/time-ranges.js
See: