ixfx
    Preparing search index...

    Function splitEvent

    • Splits event into two events by either a percentange of duration or by a specific start position.

      If options has a percentage field, the split point is calculated as event.start + (event.end - event.start) * percentage. If options has a start field, the split point is simply that value.

      splitEvent({ start: 0, end: 10 }, { percentage: 0.5 }); // [{ start: 0, end: 5 }, { start: 5, end: 10 }]
      splitEvent({ start: 0, end: 10 }, { start: 3 }); // [{ start: 0, end: 3 }, { start: 3, end: 10 }]

      Any other properties on event are copied to split events.

      Parameters

      Returns [
          a: Readonly<{ end: number; start: number }>,
          b: Readonly<{ end: number; start: number }>,
      ]

      Split event