import logging


def normalize_date(date, id_, start, end):
    """ Normalizes different dates encountered in the clinical notes.
    Current accepted formats:
        28 Feb 2913 04:50
        Thu 28 Feb 2013 04:50
        28-Feb-2013 04:50
    Output:
        28 Feb 2013 04:50
    """

    if '-' in date:
        date = date.replace("-", " ").strip()
    elif date.strip()[0].isalpha():
        date = date[date.index(' '):].strip()
    elif date.strip()[0].isnumeric():
        # all good
        date = date.strip()
    else:
        logging.warning("Unsupported date format: %s for id: %s with start: %s, end: %s", date, id_, start, end)
        return None

    return date