def format_date(date: str) -> str:
    """
    Accepts an EBI json date string and formats it for Nextstrain
    e.g. 20210100 -> 2021-01-XX
    """
    if date is None: return "?"
    date = str(date)
    year = date[:4]
    month = date[4:6].replace("00", "XX")
    day = date[6:].replace("00", "XX")
    return f"{year}-{month}-{day}"