def within(self, index):
    """
    Like between() but takes a pandas index object.

    :param pandas.Index index: pandas index
    :returns self: result of between() with start/end as the ends of the index.
    """
    try:
        start = index.min().start_time
        end = index.max().end_time
    except AttributeError:
        start = index.min()
        end = index.max()
    return self.between(start, end)