jekyll-timeago 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jekyll/timeago.rb +2 -3
- data/lib/jekyll/timeago/version.rb +1 -1
- metadata +4 -4
data/lib/jekyll/timeago.rb
CHANGED
@@ -21,9 +21,7 @@ module Jekyll
|
|
21
21
|
days_passed = (Date.today - Date.parse(date.to_s)).to_i
|
22
22
|
|
23
23
|
case days_passed.abs
|
24
|
-
when 0
|
25
|
-
'today'
|
26
|
-
when 1 .. 7
|
24
|
+
when 0 .. 7
|
27
25
|
time_ago_to_s(days_passed, :days)
|
28
26
|
when 8 .. 31
|
29
27
|
time_ago_to_s(days_passed, :weeks)
|
@@ -35,6 +33,7 @@ module Jekyll
|
|
35
33
|
end
|
36
34
|
|
37
35
|
def time_ago_to_s(days_passed, grouped_by)
|
36
|
+
return "today" if days_passed == 0
|
38
37
|
return "yesterday" if days_passed == 1
|
39
38
|
return "tomorrow" if days_passed == -1
|
40
39
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-timeago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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-
|
12
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
segments:
|
90
90
|
- 0
|
91
|
-
hash: -
|
91
|
+
hash: -411462545
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
none: false
|
94
94
|
requirements:
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
segments:
|
99
99
|
- 0
|
100
|
-
hash: -
|
100
|
+
hash: -411462545
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
103
|
rubygems_version: 1.8.24
|