datescope 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/datescope/intervals.rb +8 -8
- data/lib/datescope/version.rb +1 -1
- metadata +2 -2
data/lib/datescope/intervals.rb
CHANGED
@@ -2,32 +2,32 @@ module DateScope
|
|
2
2
|
|
3
3
|
module Intervals
|
4
4
|
def self.today
|
5
|
-
{:start => 0.day.ago.beginning_of_day, :end => 0.day.ago.end_of_day}
|
5
|
+
{:start => 0.day.ago.beginning_of_day, :end => 0.day.ago.end_of_day, :type => "day"}
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.this_week
|
9
|
-
{:start => 0.week.ago.beginning_of_week, :end => 0.week.ago.end_of_week}
|
9
|
+
{:start => 0.week.ago.beginning_of_week, :end => 0.week.ago.end_of_week, :type => "week"}
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.this_month
|
13
|
-
{:start => 0.month.ago.beginning_of_month, :end => 0.month.ago.end_of_month}
|
13
|
+
{:start => 0.month.ago.beginning_of_month, :end => 0.month.ago.end_of_month, :type => "month"}
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.this_year
|
17
|
-
{:start => 0.year.ago.beginning_of_year, :end => 0.year.ago.end_of_year}
|
17
|
+
{:start => 0.year.ago.beginning_of_year, :end => 0.year.ago.end_of_year, :type => "year"}
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.last_month
|
21
|
-
{:start => 1.month.ago.beginning_of_month, :end => 1.month.ago.end_of_month}
|
21
|
+
{:start => 1.month.ago.beginning_of_month, :end => 1.month.ago.end_of_month, :type => "month"}
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.month_before_last_month
|
25
|
-
{:start => 2.month.ago.beginning_of_month, :end => 2.month.ago.end_of_month}
|
25
|
+
{:start => 2.month.ago.beginning_of_month, :end => 2.month.ago.end_of_month, :type => "month"}
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.all
|
29
|
-
{:start => Time.at(0), :end => Time.at(2**31-1)}
|
29
|
+
{:start => Time.at(0), :end => Time.at(2**31-1), :type => "all"}
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
end
|
33
|
+
end
|
data/lib/datescope/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: datescope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Laszlo Papp
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-10-
|
13
|
+
date: 2012-10-26 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|