simpify isDate() and remove unnecessary semicolon.