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 +4 -4
- data/app/assets/javascripts/adherent/date_picker.js +15 -3
- data/app/views/adherent/members/_form.html.erb +4 -4
- data/config/initializers/date_picker_input.rb +2 -0
- data/lib/adherent/version.rb +1 -1
- data/test/dummy/log/development.log +5090 -0
- data/test/dummy/log/test.log +631 -0
- data/test/dummy/tmp/cache/assets/CAD/BF0/sprockets%2Fd27d4e6bd84d0108fc54a21959181335 +0 -0
- data/test/dummy/tmp/cache/assets/D14/210/sprockets%2Fb5db5427cdef8d152ae598d461178026 +0 -0
- data/test/dummy/tmp/cache/assets/D20/590/sprockets%2F22948c5cb4a59a4c252888f75cdf387a +0 -0
- data/test/dummy/tmp/cache/assets/D73/8B0/sprockets%2Fac0e6a1f5b87c2966f07864c89c0acc3 +0 -0
- data/test/dummy/tmp/cache/assets/D7B/800/sprockets%2F850d92cf676cc2c2c662ee8dc328f82c +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7787de31b1b18aeadd9dd60963f7077052ff9ca
|
4
|
+
data.tar.gz: 7506671e687efe92173af67b1f3ff7f4154a82b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
19
|
-
maxDate:
|
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,
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
data/lib/adherent/version.rb
CHANGED