docs: def time_ago_to_date(value):
      """
      Parse a date and return it as ``datetime.date`` objects. Examples of valid dates:
  
          * Relative: 2 days ago, today, yesterday, 1 week ago
          * Absolute: 25.10.2017
      """
      today = datetime.date.today()
  
      if value == 'today':
          return today
      elif value == 'yesterday':
          return today - datetime.timedelta(days=1)
  
      time_ago = re.match(r'(\d+) (days?|weeks?|months?|years?) ago', value)
  
      if time_ago:
          duration, unit = int(time_ago.group(1)), time_ago.group(2)
  
          if 'day' in unit:
              return today - datetime.timedelta(days=duration)
          elif 'week' in unit:
              return today - datetime.timedelta(weeks=duration)
          elif 'month' in unit:
              return months_ago(today, duration)
          elif 'year' in unit:
              return today.replace(year=today.year - duration)
  
      return datetime.datetime.strptime(value, '%d.%m.%Y').date()