semantic_date_time_tags 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd779a26b39abb5e57b3ee76930c189d9d9e4e4c
|
4
|
+
data.tar.gz: 4319fc74b0cd79f290f4693a67c91f99543a8019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d466220153da01be35c987bd981fa5610656b662188f92c0cc3c0d3941f8fcf23bae5e50f546432e848ba639db30ffaa1a572cee8ff194f0256eddcc4a394a88
|
7
|
+
data.tar.gz: 7887bb40ffb2e659257b255c8eeaec1396f5345c58ac86a4e46d8e3973f83bb518cbe69259ba5cf36db9e0bfcc8deb7072a21b9011887ebf23635655b8f0ca8b
|
data/Gemfile.lock
CHANGED
@@ -4,6 +4,7 @@ module SemanticDateTimeTags
|
|
4
4
|
|
5
5
|
attr_accessor :date_from
|
6
6
|
attr_accessor :date_to
|
7
|
+
attr_accessor :options
|
7
8
|
|
8
9
|
def initialize date_from, date_to=nil, options={}
|
9
10
|
@date_from = date_from
|
@@ -57,15 +58,15 @@ module SemanticDateTimeTags
|
|
57
58
|
|
58
59
|
def to_html
|
59
60
|
from = case date_from
|
60
|
-
when ::DateTime then SemanticDateTimeTags::Tag::DateTime.new(date_from, class: 'from').to_html
|
61
|
-
when ::Date then SemanticDateTimeTags::Tag::Date.new(date_from.to_date, class: 'from').to_html
|
61
|
+
when ::DateTime then SemanticDateTimeTags::Tag::DateTime.new(date_from, options.merge(class: 'from')).to_html
|
62
|
+
when ::Date then SemanticDateTimeTags::Tag::Date.new(date_from.to_date, options.merge(class: 'from')).to_html
|
62
63
|
end
|
63
64
|
|
64
65
|
sep = content_tag(:span, separator, class: 'date_range_separator')
|
65
66
|
|
66
67
|
to = case date_to
|
67
|
-
when ::DateTime then SemanticDateTimeTags::Tag::DateTime.new(date_to, class: 'to').to_html
|
68
|
-
when ::Date then SemanticDateTimeTags::Tag::Date.new(date_to.to_date, class: 'to').to_html
|
68
|
+
when ::DateTime then SemanticDateTimeTags::Tag::DateTime.new(date_to, options.merge(class: 'to')).to_html
|
69
|
+
when ::Date then SemanticDateTimeTags::Tag::Date.new(date_to.to_date, options.merge(class: 'to')).to_html
|
69
70
|
end
|
70
71
|
|
71
72
|
content_tag(:span, class: dom_classes) { [ from, sep, to ].join.html_safe }.html_safe
|
@@ -177,6 +177,10 @@ describe SemanticDateTimeTags::ViewHelpers do
|
|
177
177
|
it 'has an alias of semantic_date_tim_range_tag' do
|
178
178
|
semantic_date_time_range_tag(date_object, date_tomorrow_object).must_match /<time.+?semantic.+?date.+?from.+?>/
|
179
179
|
end
|
180
|
+
|
181
|
+
it 'allows to pass :format' do
|
182
|
+
semantic_date_time_range_tag(date_object, date_tomorrow_object, format: :test).must_include '~'
|
183
|
+
end
|
180
184
|
end
|
181
185
|
|
182
186
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_date_time_tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|