function max(selector) { var max=null; $(selector).each(function() { var id = parseInt($(this).data("step"), 10); if ((max===null) || (id > max)) { max = id; } }); return max; } //inserts element to let configure the steps function insertStepForm(element){ var steps = parseInt($(element).val()); if(element.min > steps || (element.max && element.max < steps)){ element.reportValidity(); return; } if(NaN == steps) $(".step").remove(); else{ if($(".step").length > steps){ for(i = $(".step").length - 1; i >= steps; i--) $("#step"+i).remove(); } else{ for(i = $(".step").length; i < steps; i++){ var t_step = "
"); $("#submit").before(t_step); const options = {dateFormat : "dd/mm/yy", firstDay: 1} if(typeof activity_id !== "undefined"){ options.minDate = activityStartDate; options.maxDate = activityEndDate; } $("#step_"+i+"_date").datepicker(options); } } } } function addStepForm(){ //TODO: verifica che sia utilizzabile per la funzione precedente (ossia se รจ codice duplicato) i = (max(".step[data-step]") + 1) var t_step = ""); $("#submit").before(t_step); const options = {dateFormat : "dd/mm/yy", firstDay: 1} if(typeof activity_id !== "undefined"){ options.minDate = activityStartDate; options.maxDate = activityEndDate; } $("#step_"+i+"_date").datepicker(options); } function cercamap(region_id){ $.ajax({ url : "https://fxistudio.it/luduschampionshipseries/tms/sys/ajax/get_page.php", data : {op : "get_region", region : region_id}, success : function(data){ $("#organizer_div").html(data); $('html,body').animate({ scrollTop: $('#organizer_div').offset().top },'slow'); }}); } function pad(num, size){ var s = num+""; while (s.length < size) s = "0" + s; return s; } $(document).ready(function(){ /*for(i = 0; i < $(".step").length; i++) $("#step_"+i+"_date").datepicker({dateFormat : "dd/mm/yy"}); //$("#step_date").datepicker({dateFormat : "dd/mm/yy"});*/ /*$(".logo_container").append("