def METHOD_NAME(string):
    """ handle conversion from string to timeinterval """
    if not string:
        return None
    tp = TimeInterval()
    for segment in string.split(','):
        split = segment.split('-')
        if len(split) == 2:
            (start, end) = map(TimePoint, split)
            if not (start.valid and end.valid):
                return None
            tp.add(TimeSegment(start, end))
        else:
            return None
    return tp