capping time range value in case they’er out of range.