timetastic 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/timetastic.rb +6 -0
- metadata +2 -2
data/lib/timetastic.rb
CHANGED
@@ -24,11 +24,17 @@ module Timetastic
|
|
24
24
|
def days_between(b, e)
|
25
25
|
(e.to_i - b.to_i) / 60 / 60 / 24
|
26
26
|
end
|
27
|
+
|
27
28
|
def days_and_months_between(b, e)
|
29
|
+
# WARN: BUGGY! is capped @ 12 months (does not account for year wrapping)
|
28
30
|
t = Time.at(e.to_i - b.to_i)
|
29
31
|
[ t.day, t.month ]
|
30
32
|
end
|
31
33
|
|
34
|
+
def months_between(b, e)
|
35
|
+
(Time.at(e.to_i - b.to_i) / 2.62974e6).ceil
|
36
|
+
end
|
37
|
+
|
32
38
|
alias_method :coming, :next
|
33
39
|
|
34
40
|
# Fixes the relative time by which all of Timetastic operations
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timetastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|