Clip ToYear dates in DB.

-ToYear for some timelines is set to 9999 to indicate ongoing event but this confilcts with minspan calculations. Therefore we need to clip ToYear values before calculating minspan.