from datetime import datetime


def format_t(t):
    """
    Formats the date strings of a Wikidata entry
    """
    if t is not None:
        return datetime.strptime(t[1:11].replace("-00", "-01"), "%Y-%m-%d").date()
    else:
        return t