icambron / twix.js

:hourglass::left_right_arrow: A date range plugin for moment.js
https://isaaccambron.com/twix.js/
MIT License
379 stars 54 forks source link

Mutate start / end #115

Closed strarsis closed 5 years ago

strarsis commented 5 years ago

How can start / end of a twix range be mutated, e.g. hours added?

icambron commented 5 years ago

The best way is to just create a new one, like

var newTwix = someTwix.start().add(1, "hours").twix(someTwix.end().subtract(1, "days");