more strict check before trying to parse and detect a string as a date
fixes #2694