Fix parsing invalid date string (#1489035)