I'm trying to filter the query set in the BaseDatatableView on a date that's entered in by the user in the following format: mm/dd/yyyy. So start_date is in that format and will get converted to a datetime with strptime, see below.
I'd like to compare it to exactly a date datetimefield in the db, but i'd like to match the month, day, year exactly, disregarding the time. This is what I have so that doesn't work.
class AppointmentListJson(LoginRequiredMixin, BaseDatatableView):
....
start_date = params.get('start_date', '')
if start_date:
qs = qs.filter(start_date__contains=datetime.strptime(
start_date, DATE_FORMAT))
return qs
Thanks