You may find a function and working example here:

https://github.com/Inflectra/rapise-powerpack/tree/master/IncrementDate