Add option to set end time instead of only duration