<=date includes whole day
@@ -241,7 +241,14 @@ class ParseSQ(object):
thisday_object = parse_date(word)
thisday = thisday_object.strftime("%Y-%m-%dT%H:%M:%SZ")
if inequality_operator:
- self.sq = self.apply_operand(SQ(**{search_field+inequality_operator: thisday}))
+ if inequality_operator == '<=': # include whole day of target date
+ nextday_object = thisday_object + timedelta(days=1)
+ nextday = nextday_object.strftime("%Y-%m-%dT%H:%M:%SZ")
+ self.sq = self.apply_operand(
+ SQ(**{search_field+"__lt": nextday}))
+ else:
+ self.sq = self.apply_operand(
+ SQ(**{search_field+inequality_operator: thisday}))
else:
# limit creation date to one day by generating two inequalities
nextday_object = thisday_object + timedelta(days=1)
