wordnik_ruby_helpers 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wordnik_ruby_helpers/version.rb +1 -1
- data/lib/wordnik_ruby_helpers.rb +2 -1
- metadata +2 -2
data/lib/wordnik_ruby_helpers.rb
CHANGED
@@ -20,7 +20,8 @@ module WordnikRubyHelpers
|
|
20
20
|
# Use words if within the last week, otherwise use date (show year if not this year)
|
21
21
|
def time_ago_in_words_or_date(date,options={})
|
22
22
|
return unless date
|
23
|
-
|
23
|
+
date = Date.parse(date)
|
24
|
+
if (Date.today-date)/60/60/24 < 7
|
24
25
|
time_ago_in_words(date) + " ago"
|
25
26
|
elsif date.year == Time.now.year
|
26
27
|
options[:short_format] ? date.strftime(options[:short_format]) : date.strftime("%b %e").gsub(" ", " ")
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: wordnik_ruby_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Zeke Sikelianos
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-06-02 00:00:00 -05:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|