timepiece 0.2.10 → 0.2.11

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: 6480f060e551a2440f4b5da6a0acbc53e30d410f
4
- data.tar.gz: d41872ef5d130cb686f2707f3be8fe09806e0e83
3
+ metadata.gz: ac6efdf331bb0b17f63ab0cac25a119b81d4d777
4
+ data.tar.gz: b65569f6c75839a15386af593e8b3ffa97bb6243
5
5
  SHA512:
6
- metadata.gz: edbdeaa73f7fadcbd22c53fc56516489fc209b4521bfcbfd21fd55ea02621dc6ad3b6329c80fdd79ee0d95a50adcce9af502eacadc5a772ed1610efa05acbb61
7
- data.tar.gz: 5cdd6acfd951a3ee06470511f5437112069a3706bc579a50bddbde672f3c41f532e4306c0e575f71121a3d48f2579f2de190a044c050b01e2e6d3399ece65cf6
6
+ metadata.gz: 109bb9fb982545a19088753d7853d4d190cf23c6efcbe88406ffa230e3912a5a9f64457aa62ac63c61ba03fcb7defd20404066394347d33c02ea36a60e51195b
7
+ data.tar.gz: 14a2dbdca298612e79a27d13fc4f8ded53c38fd22daa6ab483a1c5101a74db96516bda8afe30792ee41419ccde23c75aab8bbb231cabac41b1f24e228cb82102
@@ -207,19 +207,19 @@
207
207
  } else {
208
208
  $('.tp-descriptor-days', $(e)).html(' days ');
209
209
  }
210
- $('.timepiece-hours', $(e)).html(timer_hours[i]);
210
+ $('.timepiece-hours', $(e)).html(( timer_hours[i] < 10 ? "0" : "" ) + timer_hours[i]);
211
211
  if (timer_hours[i] == 1){
212
212
  $('.tp-descriptor-hours', $(e)).html('&nbsp;hour ');
213
213
  } else {
214
214
  $('.tp-descriptor-hours', $(e)).html('&nbsp;hours ');
215
215
  }
216
- $('.timepiece-minutes', $(e)).html(timer_minutes[i]);
216
+ $('.timepiece-minutes', $(e)).html(( timer_minutes[i] < 10 ? "0" : "" ) + timer_minutes[i]);
217
217
  if (timer_minutes[i] == 1){
218
218
  $('.tp-descriptor-minutes', $(e)).html('&nbsp;minute ');
219
219
  } else {
220
220
  $('.tp-descriptor-minutes', $(e)).html('&nbsp;minutes ');
221
221
  }
222
- $('.timepiece-seconds', $(e)).html(timer_seconds[i]);
222
+ $('.timepiece-seconds', $(e)).html(( timer_seconds[i] < 10 ? "0" : "" ) + timer_seconds[i]);
223
223
  if (timer_seconds[i] == 1){
224
224
  $('.tp-descriptor-seconds', $(e)).html('&nbsp;second ');
225
225
  } else {
@@ -284,19 +284,19 @@
284
284
  } else {
285
285
  $('.tp-descriptor-days', $(e)).html('&nbsp;days ');
286
286
  }
287
- $('.timepiece-hours', $(e)).html(countdown_hours[i]);
287
+ $('.timepiece-hours', $(e)).html(( countdown_hours[i] < 10 ? "0" : "" ) + countdown_hours[i]);
288
288
  if (countdown_hours[i] == 1){
289
289
  $('.tp-descriptor-hours', $(e)).html('&nbsp;hour ');
290
290
  } else {
291
291
  $('.tp-descriptor-hours', $(e)).html('&nbsp;hours ');
292
292
  }
293
- $('.timepiece-minutes', $(e)).html(countdown_minutes[i]);
293
+ $('.timepiece-minutes', $(e)).html(( countdown_minutes[i] < 10 ? "0" : "" ) + countdown_minutes[i]);
294
294
  if (countdown_minutes[i] == 1){
295
295
  $('.tp-descriptor-minutes', $(e)).html('&nbsp;minute ');
296
296
  } else {
297
297
  $('.tp-descriptor-minutes', $(e)).html('&nbsp;minutes ');
298
298
  }
299
- $('.timepiece-seconds', $(e)).html(countdown_seconds[i]);
299
+ $('.timepiece-seconds', $(e)).html(( countdown_seconds[i] < 10 ? "0" : "" ) + countdown_seconds[i]);
300
300
  if (countdown_seconds[i] == 1){
301
301
  $('.tp-descriptor-seconds', $(e)).html('&nbsp;second ');
302
302
  } else {
@@ -81,11 +81,11 @@ module TimepieceHelper
81
81
 
82
82
  time = "<span class='timepiece-days'>#{days.to_s}</span>"\
83
83
  "<span class='timepiece-separator tp-separator-days-hours'>:</span>"\
84
- "<span class='timepiece-hours'>#{hours.to_s}</span>"\
84
+ "<span class='timepiece-hours'>#{"%02d" % hours}</span>"\
85
85
  "<span class='timepiece-separator tp-separator-hours-minutes'>:</span>"\
86
- "<span class='timepiece-minutes'>#{minutes.to_s}</span>"\
86
+ "<span class='timepiece-minutes'>#{"%02d" % minutes}</span>"\
87
87
  "<span class='timepiece-separator tp-separator-minutes-seconds'>:</span>"\
88
- "<span class='timepiece-seconds'>#{seconds.to_s}</span>"
88
+ "<span class='timepiece-seconds'>#{"%02d" % seconds}</span>"
89
89
  # "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
90
90
 
91
91
  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?))
@@ -133,11 +133,11 @@ module TimepieceHelper
133
133
 
134
134
  time = "<span class='timepiece-days'>#{days.to_s}</span>"\
135
135
  "<span class='timepiece-separator tp-separator-days-hours'>:</span>"\
136
- "<span class='timepiece-hours'>#{hours.to_s}</span>"\
136
+ "<span class='timepiece-hours'>#{"%02d" % hours}</span>"\
137
137
  "<span class='timepiece-separator tp-separator-hours-minutes'>:</span>"\
138
- "<span class='timepiece-minutes'>#{minutes.to_s}</span>"\
138
+ "<span class='timepiece-minutes'>#{"%02d" % minutes}</span>"\
139
139
  "<span class='timepiece-separator tp-separator-minutes-seconds'>:</span>"\
140
- "<span class='timepiece-seconds'>#{seconds.to_s}</span>"
140
+ "<span class='timepiece-seconds'>#{"%02d" % seconds}</span>"
141
141
  # "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
142
142
 
143
143
  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?))
@@ -1,3 +1,3 @@
1
1
  module Timepiece
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timepiece
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails