def span_from_date(date)
      return [nil, nil] if date.nil?
      if date.is_a?(Date)
        return [date, date] if date.precision == :day
        return [date, (date.succ - 1)]
      end
      [(date.respond_to?(:first) ? date.first : date.from),
       (date.respond_to?(:last) ? date.last : date.to)]
    end
def span_from_date(date)
      return [nil, nil] if date.nil?
      if date.is_a?(Date)
        return [date, date] if date.precision == :day
        return [date, (date.succ - 1)]
      end
      [(date.respond_to?(:first) ? date.first : date.from),
       (date.respond_to?(:last) ? date.last : date.to)]
    end
Converts an EDTF date to a begin and end date.

 @param date [Date, DateTime, EDTF::Interval] a date, with or without EDTF
   precision features; or an interval.

 @return [Array<Date, DateTime>] an array of two elements containing the
   begin and end dates.