lib/redistat/finder/date_set.rb in redistat-0.3.0 vs lib/redistat/finder/date_set.rb in redistat-0.4.0
- old
+ new
@@ -1,9 +1,9 @@
module Redistat
class Finder
class DateSet < Array
-
+
def initialize(start_date = nil, end_date = nil, depth = nil, interval = false)
if !start_date.nil? && !end_date.nil?
find_date_sets(start_date, end_date, depth, interval)
end
end
@@ -69,11 +69,11 @@
end_date.beginning_of(nunit).beginning_of_each(unit, :include_start => true, :include_end => lowest_depth).until(end_date) do |t|
add << t.to_rs.to_s(unit) if t > start_date.beginning_of(unit)
end
{ :add => add, :rem => [] }
elsif has_nunit
- { :add => [end_date.beginning_of(nunit).to_rs.to_s(nunit)],
+ { :add => [end_date.beginning_of(nunit).to_rs.to_s(nunit)],
:rem => end_date.map_beginning_of_each(unit, :include_start => !lowest_depth).until(end_date.end_of(nunit)) { |t| t.to_rs.to_s(unit) } }
else
{ :add => [], :rem => [] }
end
end
@@ -91,9 +91,9 @@
{ :add => [end_date.beginning_of_year.to_rs.to_s(:year)], :rem => [] }
else
{ :add => [], :rem => [] }
end
end
-
+
end
end
-end
\ No newline at end of file
+end