Fix bug when creating a new timeline.

Implements [2433](https://www.openproject.org/issues/2433)