duration_time 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -3
- data/duration_time.gemspec +1 -1
- data/lib/duration_time.rb +1 -1
- metadata +3 -3
data/README
CHANGED
@@ -5,9 +5,7 @@ Usage:
|
|
5
5
|
|
6
6
|
# Assume that today is 2013-07-07
|
7
7
|
require 'duration_time'
|
8
|
-
reg_time = Time.new(2011,8,2
|
9
|
-
# You can use reg_time = Date.parse("2011-08-02") if you have included
|
10
|
-
# gem active_support!
|
8
|
+
reg_time = Time.new(2011,8,2)
|
11
9
|
duration_time( reg_time )
|
12
10
|
# => {
|
13
11
|
# :years=>[2011, 2012, 2013],
|
data/duration_time.gemspec
CHANGED
data/lib/duration_time.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
def
|
2
|
+
def duration_time(reg_date, current_date = Time.now, include_current_year_month = false)
|
3
3
|
to_current_year_month = include_current_year_month ? current_date.month : current_date.month - 1
|
4
4
|
|
5
5
|
years = (reg_date.year..current_date.year).to_a; months = []; quarters = []
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duration_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- debbbbie
|