ixfx
    Preparing search index...

    Function translate

    • Translates an event by adding amount to both start and end, returning a new event.

      translate( { start:1, end:2 }, 3);  // { start:4, end:5 }
      translate( { start:1, end:2 }, -1); // { start:0, end:1 }

      Existing data on event is maintained.

      Use applyToPositions if you want to apply a custom function to the start and end, instead of just adding an amount.

      Type Parameters

      • T extends Readonly<{ end: number; start: number }>

      Parameters

      • event: T
      • amount: number

      Returns T

      New EventItem