Date::isValid function changed