Applies fn to both start and end fields, returning a new event.
fn
start
end
Existing data on event is maintained.
event
applyToPosition( { start:1.2, end:2.4 }, v => Math.round(v)); // { start:1, end:2 }applyToPosition( { start:1, end:2 }, v => v*2); // { start:2, end:4 } Copy
applyToPosition( { start:1.2, end:2.4 }, v => Math.round(v)); // { start:1, end:2 }applyToPosition( { start:1, end:2 }, v => v*2); // { start:2, end:4 }
Use translate if you just want to add an amount to start and end, instead of applying a custom function.
Input event
Function to run over start and end
New event with fn applied to start and end
Applies
fnto bothstartandendfields, returning a new event.Existing data on
eventis maintained.Use translate if you just want to add an amount to start and end, instead of applying a custom function.