jquery-timepicker-rails 1.3.7 → 1.3.8

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: 0fb17242a86d02827fc6ab90ffea9f5747fc4150
4
- data.tar.gz: b2de80eb6c4f3d16441acd8ddf3aab411338d76f
3
+ metadata.gz: 58c295d9f0d5754e344f2d3722b1dae65261aadc
4
+ data.tar.gz: 601935bee43c7788d1fbfd4be3feab4014ce75e3
5
5
  SHA512:
6
- metadata.gz: 8330a27a44f59e6e677e46612c8f11015536655eb29c64cd7d8d1575b06e719230d39b8d01a624ba9a59e381410f77ad236345f321beae9bb96f06dfe0bef88e
7
- data.tar.gz: c38ed839513800a97c46ea1a92caa149748f83b799c254510b59868b6145cfe445162938cc15a92b4893c863ecadc2ed9701b77344ede69641d5cdf144eaa0f5
6
+ metadata.gz: a444ffe6e31b2679ba4ed11fa86df9aa2f20b79eb35792d58250a7239d05cd6fe6f27fed9eb91f786669311b9fba1b0995e59b514b6df4eed2c429b14bccb078
7
+ data.tar.gz: b388975a0ebdacb844bccabe1956ebc1917cfef49c47a1c03041760419ee00b498c0b5620779d484f99eefae27d9aa361a1cf321bd4e92f57347670ea0c07986
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Timepicker
3
3
  module Rails
4
- VERSION = "1.3.7"
4
+ VERSION = "1.3.8"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  /************************
2
- jquery-timepicker v1.3.7
2
+ jquery-timepicker v1.3.8
3
3
  http://jonthornton.github.com/jquery-timepicker/
4
4
 
5
5
  requires jQuery 1.7+
@@ -391,6 +391,7 @@ requires jQuery 1.7+
391
391
 
392
392
  if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
393
393
  wrapped_list.addClass('ui-timepicker-with-duration');
394
+ wrapped_list.addClass('ui-timepicker-step-'+settings.step);
394
395
  }
395
396
 
396
397
  var durStart = settings.minTime;
@@ -904,17 +905,31 @@ requires jQuery 1.7+
904
905
 
905
906
  function _int2duration(seconds)
906
907
  {
907
- var minutes = Math.round(seconds/60);
908
- var duration;
908
+ var minutes = Math.round(seconds/60),
909
+ duration = [],
910
+ hours, mins;
909
911
 
910
- if (Math.abs(minutes) < 60) {
912
+ if (minutes < 60) {
913
+ // Only show (x mins) under 1 hour
911
914
  duration = [minutes, _lang.mins];
912
- } else if (minutes == 60) {
913
- duration = ['1', _lang.hr];
914
915
  } else {
915
- var hours = (minutes/60).toFixed(1);
916
- if (_lang.decimal != '.') hours = hours.replace('.', _lang.decimal);
917
- duration = [hours, _lang.hrs];
916
+ hours = Math.floor(minutes/60);
917
+ mins = minutes%60;
918
+
919
+ // Show decimal notation (eg: 1.5 hrs) for 30 minute steps
920
+ if (step == 30 && mins == 30) {
921
+ hours += _lang.decimal + 5;
922
+ }
923
+
924
+ duration.push(hours);
925
+ duration.push(hours == 1 ? _lang.hr : _lang.hrs);
926
+
927
+ // Show remainder minutes notation (eg: 1 hr 15 mins) for non-30 minute steps
928
+ // and only if there are remainder minutes to show
929
+ if (step != 30 && mins) {
930
+ duration.push(mins);
931
+ duration.push(_lang.mins);
932
+ }
918
933
  }
919
934
 
920
935
  return duration.join(' ');
@@ -13,6 +13,11 @@
13
13
  }
14
14
 
15
15
  .ui-timepicker-wrapper.ui-timepicker-with-duration {
16
+ width: 14em;
17
+ }
18
+
19
+ .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,
20
+ .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60 {
16
21
  width: 11em;
17
22
  }
18
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-timepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanguy Krotoff (jQuery plugin by Jon Thornton)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-20 00:00:00.000000000 Z
12
+ date: 2014-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties