code: def parse_date_input(value):
      
      try:
          limit = parse_date(value)
      except ValueError:
          limit = None
      if limit is None:
          raise ValueError("'{}' is not a valid date.".format(value))
      limit = datetime(limit.year, limit.month, limit.day)
      if settings.USE_TZ:
          limit = make_aware(limit)
      return limit
docs: Return datetime based on the user's input.
  
      @param value: User's input
      @type value: str
      @raise ValueError: If the input is not valid.
      @return: Datetime of the beginning of the user's date.