timepiece 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/timepiece_helper.rb +4 -3
- data/lib/timepiece/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4011a52353edd24eb8f23f78304aec8dd6d07b93
|
4
|
+
data.tar.gz: a5df48bc631f9b27564bdd0a9d603f95880db673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca13f3397694238ec9a55e32caf22299c8e60b1c57f8196515cbe94779b43bafd9f7f507e9006e497714bb344af0eb35d36c2caf8854ef6b9de0c9842253c689
|
7
|
+
data.tar.gz: a8d991df7a968ab69141b51d283e2b81a3b5f45fecfeb31e59a128e0ee63e5371ff0555eed3fa006ec78b40813be78496525b15977520de370b0f74c136e4036
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module TimepieceHelper
|
2
2
|
def timepiece(location = 'UTC', type: '24', lead: 'none', abbr_sep: 'none', id: '')
|
3
|
+
# Note: On the inclusion of IDs, you should /not/ display them if none is given - HTML compliance.
|
3
4
|
Time.zone = location
|
4
5
|
hours = Time.now.in_time_zone.strftime('%H')
|
5
6
|
minutes = Time.now.in_time_zone.strftime('%M')
|
@@ -36,7 +37,7 @@ module TimepieceHelper
|
|
36
37
|
if type == '12'
|
37
38
|
time = time + "<span class='timepiece-abbr timepiece-abbr-#{var}'>#{var}</span>"
|
38
39
|
end
|
39
|
-
content_tag(:span, time.html_safe, class: 'timepiece', 'data-timezone' => location, 'data-tptype' => type, 'data-lead' => lead, 'data-abbr_separator' => abbr_sep, 'id' => id)
|
40
|
+
content_tag(:span, time.html_safe, class: 'timepiece', 'data-timezone' => location, 'data-tptype' => type, 'data-lead' => lead, 'data-abbr_separator' => abbr_sep, 'id' => (id unless id.blank?))
|
40
41
|
end
|
41
42
|
|
42
43
|
def timer(time_since = Time.now, id: '')
|
@@ -63,7 +64,7 @@ module TimepieceHelper
|
|
63
64
|
"<span class='timepiece-descriptor tp-descriptor-seconds'> seconds </span>"
|
64
65
|
# "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
|
65
66
|
|
66
|
-
content_tag(:span, time.html_safe, class: 'timepiece-timer', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => id)
|
67
|
+
content_tag(:span, time.html_safe, class: 'timepiece-timer', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => (id unless id.blank?))
|
67
68
|
end
|
68
69
|
|
69
70
|
def countdown(time_until = Time.new(2016), id: '')
|
@@ -90,6 +91,6 @@ module TimepieceHelper
|
|
90
91
|
"<span class='timepiece-descriptor tp-descriptor-seconds'> seconds </span>"
|
91
92
|
# "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
|
92
93
|
|
93
|
-
content_tag(:span, time.html_safe, class: 'timepiece-countdown', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => id)
|
94
|
+
content_tag(:span, time.html_safe, class: 'timepiece-countdown', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => (id unless id.blank?))
|
94
95
|
end
|
95
96
|
end
|
data/lib/timepiece/version.rb
CHANGED