Skip to content

@eightkk/vue-weave / core / invertWorkPeriods

Function: invertWorkPeriods() ​

invertWorkPeriods(periods, range): TimeRange[]

Defined in: src/core/workCalendar.ts:71

The sorted half-open gaps between working periods inside range, for example the non-working time to shade on a chart. The periods are clipped, sorted and merged first, so they may be unsorted, overlapping or touching. Unlike normalizeWorkPeriods, endpoints only need to be finite, so any numeric unit works, including fractions.

Parameters ​

periods ​

readonly TimeRange[]

range ​

TimeRange

Returns ​

TimeRange[]

Released under the MIT License.