adherent 0.0.5 → 0.0.6

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: ba46783a27188c6ccbdd5847f0a5eb3e37c8db5b
4
- data.tar.gz: 9d2d71d436c1e0c2c2cd329102692b5bfb085f0d
3
+ metadata.gz: a7787de31b1b18aeadd9dd60963f7077052ff9ca
4
+ data.tar.gz: 7506671e687efe92173af67b1f3ff7f4154a82b0
5
5
  SHA512:
6
- metadata.gz: 0d4e4d6354057cc9648694dcd549e30b179351affad8a978579b4df132ce0bf6981c3c41f8d4bbfefc23b39201174ec41459678b4f3a55729af9fc4ed0a7b774
7
- data.tar.gz: 62e9987c7ed5eced145c9d873adc7b133dd08e20e35b910ecd3bf48eedb4c64220a44e9b645dbaebbcf38e3aefd601932e4ecd4a3e090fd2eb6d47378e046c87
6
+ metadata.gz: 68ea29a9a2154252512ffcc7cbf1ad88dd074028f8a464ec8558e0aeac4e0b5a31950a9c797311674c5d660b5a694af389053adf68bc1dbec5c33c644c4abced
7
+ data.tar.gz: 0942da8798602888cd07f1cce0dbb3e1faaac00fd4b878b99d24e944b3e1db8ccbab4b6bab76188a7f303d1362c2070eb56335be9066767b189d96a0ee5d5081
@@ -11,14 +11,26 @@
11
11
  // date max sont transmis par cette fonction sous forme d'attributs data-jcmin et data-jcmax
12
12
  jQuery(function () {
13
13
  jQuery.each($('.input_date_picker'), function (index, val) {
14
-
14
+ var input_month_year = false;
15
+ var date_min = $(val).attr('data-jcmin');
16
+ var date_max = $(val).attr('data-jcmax');
17
+ var year_min = date_min.slice(-4);
18
+ var year_max = date_max.slice(-4);
19
+ if ($(val).attr('data-with-month-year') === 'avec') {
20
+ input_month_year = true;
21
+ }
22
+
15
23
  $(val).datepicker(
16
24
  {
17
25
  dateFormat: 'dd/mm/yy',
18
- minDate: $(val).attr('data-jcmin'),
19
- maxDate: $(val).attr('data-jcmax')
26
+ minDate: date_min,
27
+ maxDate: date_max,
28
+ changeMonth: input_month_year,
29
+ changeYear: input_month_year,
30
+ yearRange: year_min+":"+year_max
20
31
  }
21
32
  );
33
+
22
34
  });
23
35
  });
24
36
 
@@ -8,10 +8,10 @@
8
8
  <%= f.input :number, input_html: {class: "span3"} %>
9
9
  <%= f.input :name, input_html: {class: "span3"} %>
10
10
  <%= f.input :forname, input_html: {class: "span3"} %>
11
- <%= f.input :birthdate, input_html: {class: "span1"},
12
- start_year:(Date.today.year - 100),
13
- end_year:(Date.today.year) %>
14
- </div>
11
+ <%= f.input :birthdate,
12
+ input_html: {class: "span2", date_min:Date.today.years_ago(100), date_max:Date.today, 'data-with-month-year'=>'avec'},
13
+ :as=>:date_picker %>
14
+ </div>
15
15
  </div>
16
16
 
17
17
  <div class="form-actions">
@@ -26,11 +26,13 @@ class DatePickerInput < SimpleForm::Inputs::Base
26
26
  protected
27
27
 
28
28
  def date_min(option)
29
+
29
30
  option ||= Date.today.years_ago(5)
30
31
  option.to_formatted_s(:date_picker)
31
32
  end
32
33
 
33
34
  def date_max(option)
35
+ puts "Dans date_max l option vaut #{option}"
34
36
  option ||= Date.today.years_since(5)
35
37
  option.to_formatted_s(:date_picker)
36
38
  end
@@ -1,3 +1,3 @@
1
1
  module Adherent
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end