def weekend_init(M, i, t):
    """
    Determines days to treat as weekend using midnight threshold parameters

    :param M: Model
    :param i: period
    :param t: tour type
    :return: list of ints; either [1, 7] or [6, 7]
    """
    result = []
    lens = [M.lengths[k] for k in M.tt_length_x[t]]
    max_len = max(lens)
    if i + max_len - 1 >= M.midnight_thresh[t]:
        result.append(6)
    else:
        result.append(1)
    result.append(7)
    return result