radiant-if_date_tags-extension 1.0.1 → 1.0.2
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.
@@ -15,12 +15,12 @@ module IfDateTags::TagExtensions
|
|
15
15
|
tag 'if_date_earlier' do |tag|
|
16
16
|
than, date = than_and_date_from_attrs(tag)
|
17
17
|
condition = tag.attr['or_equal'] ? "<=" : "<"
|
18
|
-
tag.expand if
|
18
|
+
tag.expand if date.send(condition, than)
|
19
19
|
end
|
20
20
|
tag 'unless_date_earlier' do |tag|
|
21
21
|
than, date = than_and_date_from_attrs(tag)
|
22
22
|
condition = tag.attr['or_equal'] ? "<=" : "<"
|
23
|
-
tag.expand unless
|
23
|
+
tag.expand unless date.send(condition, than)
|
24
24
|
end
|
25
25
|
|
26
26
|
desc %{
|
@@ -36,12 +36,12 @@ module IfDateTags::TagExtensions
|
|
36
36
|
tag 'if_date_later' do |tag|
|
37
37
|
than, date = than_and_date_from_attrs(tag)
|
38
38
|
condition = tag.attr['or_equal'] ? ">=" : ">"
|
39
|
-
tag.expand if
|
39
|
+
tag.expand if date.send(condition, than)
|
40
40
|
end
|
41
41
|
tag 'unless_date_later' do |tag|
|
42
42
|
than, date = than_and_date_from_attrs(tag)
|
43
43
|
condition = tag.attr['or_equal'] ? ">=" : ">"
|
44
|
-
tag.expand unless
|
44
|
+
tag.expand unless date.send(condition, than)
|
45
45
|
end
|
46
46
|
|
47
47
|
def than_and_date_from_attrs(tag)
|
@@ -57,9 +57,9 @@ module IfDateTags::TagExtensions
|
|
57
57
|
end
|
58
58
|
else
|
59
59
|
tag.locals.page.published_at.to_date || tag.locals.page.created_at.to_date
|
60
|
-
end
|
60
|
+
end.to_date.to_s.gsub('-','')
|
61
61
|
|
62
|
-
than = DateTime.parse(than)
|
63
|
-
return [ than
|
62
|
+
than = DateTime.parse(than).to_date.to_s.gsub('-','')
|
63
|
+
return [ than, date ]
|
64
64
|
end
|
65
65
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-if_date_tags-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
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: 2017-07-
|
12
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Makes Radiant better by adding if_date radius tags
|
15
15
|
email:
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- lib/radiant-if_date_tags-extension.rb
|
27
27
|
- lib/tasks/if_date_tags_extension_tasks.rake
|
28
28
|
- radiant-if_date_tags-extension-1.0.0.gem
|
29
|
+
- radiant-if_date_tags-extension-1.0.1.gem
|
29
30
|
- radiant-if_date_tags-extension.gemspec
|
30
31
|
- Rakefile
|
31
32
|
- README.md
|