Catch TypeError as well as ValueError when parsing dates, ref #699