from datetime import datetime


def _to_date(string):
    """Convert a string in ISO 8601 format into a datetime.date object."""
    return datetime.strptime(string, "%Y-%m-%d").date() if string else None