import typing
from datetime import datetime


def date2date(s: str) -> typing.Optional[datetime]:
    """ Parses a string and turns it into a date object. """

    if s == "":
        return None

    return datetime.strptime(s, '%d.%m.%Y')