X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fprive%2Fformulaires%2Fdateur%2Finc-dateur.html;h=e6089879cacfdf08d472b83946b584bdf8d667a3;hp=46a6671138c623301c1c0e69c6f1d71639896472;hb=e847eea4a82a7396dd0abf860f9b30d654f38629;hpb=d686c3e22e97dd46ef42bcd0f138c65083f8f232 diff --git a/www/prive/formulaires/dateur/inc-dateur.html b/www/prive/formulaires/dateur/inc-dateur.html index 46a6671..e608987 100644 --- a/www/prive/formulaires/dateur/inc-dateur.html +++ b/www/prive/formulaires/dateur/inc-dateur.html @@ -30,7 +30,8 @@ function date_picker_options(){ changeMonth: true, changeYear: true, showOtherMonths: true, - selectOtherMonths: true + selectOtherMonths: true, + yearRange: "c-60:c+40" }; } function date_picker_init(){ @@ -41,6 +42,8 @@ function date_picker_init(){ options.minDate = jQuery(this).attr('data-startDate'); if (jQuery(this).attr('data-endDate')) options.maxDate = jQuery(this).attr('data-endDate'); + if (jQuery(this).attr('data-yearRange')) + options.yearRange = jQuery(this).attr('data-yearRange'); jQuery(this) .datepicker(jQuery.extend(date_picker_options(),options)) .trigger('datePickerLoaded'); @@ -50,12 +53,13 @@ function date_picker_init(){ var date_picker_loading; if (window.jQuery){ jQuery(function(){ - if (jQuery('input.date,input.heure').length && !date_picker_loading){ - date_picker_loading = true; // inutile de loader deux fois - jQuery.getScript('#PRODUIRE{fond=formulaires/dateur/jquery.dateur.js}').done(function(){ + if (jQuery('input.date,input.heure').length + && typeof date_picker_loading=="undefined"){ + date_picker_loading = jQuery.getScript('#PRODUIRE{fond=formulaires/dateur/jquery.dateur.js}'); + date_picker_loading.done(function(){ date_picker_init(); onAjaxLoad(date_picker_init); - }); + }) } }); }