cacheable_date_helper 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,7 +8,7 @@ module CacheableDateHelper
|
|
8
8
|
# Example: cacheable_time_ago_in_words(Time.zone.now - 2 minutes) # => <span class="time_ago_in_words" data-timestamp="Mon Jul 18 12:21:12 UTC 2011" data-include-seconds="false">18 Jul 14:21</span>
|
9
9
|
# Which will be replaced by the client-side javascript with: <span class="time_ago_in_words" data-timestamp="Mon Jul 18 12:22:11 UTC 2011" data-include-seconds="false">2 minutes ago</span>
|
10
10
|
def cacheable_time_ago_in_words(date_with_timezone, include_seconds = false)
|
11
|
-
|
11
|
+
"<span class=\"time_ago_in_words\" data-timestamp=\"#{date_with_timezone.utc}\" data-include-seconds=\"#{include_seconds}\">#{I18n.l(date_with_timezone, :format => :short)}</span>".html_safe
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cacheable_date_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Murui
|