def bounding_dates
    bounding_min = self.all_dates.select{|d| d.in_out}.map(&:date).compact.min
    bounding_max = self.all_dates.select{|d| d.in_out}.map(&:date).compact.max

    unless self.periods.empty?