from datetime import datetime


def replace_datetimes(delta):
    """Replace datetime objects with ISO formatted
    strings for JSON serialization"""
    for key, val in delta.items():
        if type(val) is datetime:
            delta[key] = val.isoformat()

    return delta