code: def where_entry_date(query, datespec):
      
      date, interval, _ = utils.parse_date(datespec)
      start_date, end_date = date.span(interval)
  
      return orm.select(
          e for e in query if
          e.local_date >= start_date.naive and
          e.local_date <= end_date.naive
      )
docs: Where clause for entries which match a textual date spec
  
      datespec -- The date spec to check for, in YYYY[[-]MM[[-]DD]] format