BUG: Bug in groupby.get_group where a datetlike wasn't always accepted (GH5267)

closes #5267