<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def where_entry_date(query, datespec):
 """ Where clause for entries which match a textual date spec datespec -- The date spec to check for, in YYYY[[-]MM[[-]DD]] format """

    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
    )