calculate correct start and end time for displayed cell