Translates an event by adding amount to both start and end, returning a new event.
amount
start
end
translate( { start:1, end:2 }, 3); // { start:4, end:5 }translate( { start:1, end:2 }, -1); // { start:0, end:1 } Copy
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.
event
Use applyToPositions if you want to apply a custom function to the start and end, instead of just adding an amount.
New EventItem
Translates an event by adding
amountto bothstartandend, returning a new event.Existing data on
eventis maintained.Use applyToPositions if you want to apply a custom function to the start and end, instead of just adding an amount.