Module: DateScope::Intervals
- Defined in:
- lib/datescope/intervals.rb
Class Method Summary collapse
- .all ⇒ Object
- .last_month ⇒ Object
- .month_before_last_month ⇒ Object
- .this_month ⇒ Object
- .this_week ⇒ Object
- .this_year ⇒ Object
- .today ⇒ Object
Class Method Details
.all ⇒ Object
28 29 30 |
# File 'lib/datescope/intervals.rb', line 28 def self.all {:start => Time.at(0), :end => Time.at(2**31-1), :type => "all"} end |
.last_month ⇒ Object
20 21 22 |
# File 'lib/datescope/intervals.rb', line 20 def self.last_month {:start => 1.month.ago.beginning_of_month, :end => 1.month.ago.end_of_month, :type => "month"} end |
.month_before_last_month ⇒ Object
24 25 26 |
# File 'lib/datescope/intervals.rb', line 24 def self.month_before_last_month {:start => 2.month.ago.beginning_of_month, :end => 2.month.ago.end_of_month, :type => "month"} end |
.this_month ⇒ Object
12 13 14 |
# File 'lib/datescope/intervals.rb', line 12 def self.this_month {:start => 0.month.ago.beginning_of_month, :end => 0.month.ago.end_of_month, :type => "month"} end |
.this_week ⇒ Object
8 9 10 |
# File 'lib/datescope/intervals.rb', line 8 def self.this_week {:start => 0.week.ago.beginning_of_week, :end => 0.week.ago.end_of_week, :type => "week"} end |
.this_year ⇒ Object
16 17 18 |
# File 'lib/datescope/intervals.rb', line 16 def self.this_year {:start => 0.year.ago.beginning_of_year, :end => 0.year.ago.end_of_year, :type => "year"} end |
.today ⇒ Object
4 5 6 |
# File 'lib/datescope/intervals.rb', line 4 def self.today {:start => 0.day.ago.beginning_of_day, :end => 0.day.ago.end_of_day, :type => "day"} end |