=30&&month==2){check=!1}else if(month==2&&day==29&&!(year%4==0&&(year%100!=0||year%400==0))){check=!1}else{check=!0}}
if(value=="0000-00-00 00:00:00"&&!jQuery(element).prop("required")){check=!0}
return this.optional(element)||check});jQuery.validator.addMethod("dateMDY",function(value,element){var check=!1;var re=/^(0[1-9]|1[012])[\/](0[1-9]|[12][0-9]|3[01])[\/]\d{4}$/;if(re.test(value)){var adata=value.split("/");var month=parseInt(adata[0],10);var day=parseInt(adata[1],10);var year=parseInt(adata[2],10);if(day==31&&(month==4||month==6||month==9||month==11)){check=!1}else if(day>=30&&month==2){check=!1}else if(month==2&&day==29&&!(year%4==0&&(year%100!=0||year%400==0))){check=!1}else{check=!0}}
if(value=="0000-00-00 00:00:00"&&!jQuery(element).prop("required")){check=!0}
return this.optional(element)||check});jQuery.validator.addMethod("dateYMD",function(value,element){var check=!1;var re=/^\d{4}[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01])$/;if(re.test(value)){var adata=value.split("-");var year=parseInt(adata[0],10);var month=parseInt(adata[1],10);var day=parseInt(adata[2],10);if(day==31&&(month==4||month==6||month==9||month==11)){check=!1}else if(day>=30&&month==2){check=!1}else if(month==2&&day==29&&!(year%4==0&&(year%100!=0||year%400==0))){check=!1}else{check=!0}}
if(value=="0000-00-00 00:00:00"&&!jQuery(element).prop("required")){check=!0}
return this.optional(element)||check});jQuery.validator.addMethod("filesize",function(value,element,maxsize){var check=!1;if((maxsize===0)||((!(element.files.length==0))&&(element.files[0].size-1){check=!0}
return this.optional(element)||check});jQuery.validator.addMethod("customvalidation",function(value,element,re){return this.optional(element)||re.test(value)});jQuery.validator.addMethod("ispair",function(value,element,id){var latval=document.getElementById(id+"_lat").value;var lngval=document.getElementById(id+"_lng").value;var check=((latval===""&&lngval==="")||(latval!==""&&lngval!==""));var relatval=/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/;var relngval=/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/;check=(latval===""||relatval.test(latval))&✓check=(lngval===""||relngval.test(lngval))&✓return check});jQuery.validator.addMethod("mindate",function(value,element,options){var check=!1;var minDate="";if(value){if(options.fromField){var fieldId=options.value;var field=document.getElementById(fieldId);if(!field){return!0}
if(field.disabled){return!0}
minDate=field.value;if(!minDate){return!0}}else{minDate=options.value}
var format,i=0,fmt={},minDateFormat,j=0,minDateFmt={},day;format=(value.indexOf(".")>-1)?"dd.mm.yyyy":((value.indexOf("/")>-1)?"mm/dd/yyyy":"yyyy-mm-dd");format.replace(/(yyyy|dd|mm)/g,function(part){fmt[part]=i++});minDateFormat=(minDate.indexOf(".")>-1)?"dd.mm.yyyy":((minDate.indexOf("/")>-1)?"mm/dd/yyyy":"yyyy-mm-dd");minDateFormat.replace(/(yyyy|dd|mm)/g,function(part){minDateFmt[part]=j++});var minDateParts=minDate.match(/(\d+)/g);var valueParts=value.match(/(\d+)/g);minDate=new Date(minDateParts[minDateFmt.yyyy],minDateParts[minDateFmt.mm]-1,minDateParts[minDateFmt.dd],0,0,0,0);if(options.shift){var shift=options.shift;day=minDate.getDate();day=day+parseInt(shift);minDate.setDate(day)}
value=new Date(valueParts[fmt.yyyy],valueParts[fmt.mm]-1,valueParts[fmt.dd],0,0,0,0);check=value>=minDate}
return this.optional(element)||check},function(options,element){if(options.fromField){var minDate="";var fieldId=options.value;var field=document.getElementById(fieldId);if(field){minDate=field.value}}else{minDate=options.value}
var format,minDateFormat,j=0,minDateFmt={},day,month,year,valDate;minDateFormat=(minDate.indexOf(".")>-1)?"dd.mm.yyyy":((minDate.indexOf("/")>-1)?"mm/dd/yyyy":"yyyy-mm-dd");minDateFormat.replace(/(yyyy|dd|mm)/g,function(part){minDateFmt[part]=j++});var minDateParts=minDate.match(/(\d+)/g);minDate=new Date(minDateParts[minDateFmt.yyyy],minDateParts[minDateFmt.mm]-1,minDateParts[minDateFmt.dd],0,0,0,0);if(options.shift){var shift=options.shift;day=minDate.getDate();day=day+parseInt(shift);minDate.setDate(day)}
format=options.format;valDate="";day=minDate.getDate();if(day<10){day="0"+day}
month=1+minDate.getMonth();if(month<10){month="0"+month}
year=minDate.getFullYear();switch(format){case "%Y-%m-%d":valDate=year+"-"+month+"-"+day;break;case "%m/%d/%Y":valDate=month+"/"+day+"/"+year;break;default:valDate=day+"."+month+"."+year;break}
return jQuery.validator.format("Das gewählte Datum muss mindestens {0} sein.",valDate)});jQuery.validator.addMethod("maxdate",function(value,element,options){var check=!1;var minDate="";if(value){if(options.fromField){var fieldId=options.value;var field=document.getElementById(fieldId);if(!field){return!0}
if(field.disabled){return!0}
minDate=field.value;if(!minDate){return!0}}else{minDate=options.value}
var format,i=0,fmt={},minDateFormat,j=0,minDateFmt={},day;format=(value.indexOf(".")>-1)?"dd.mm.yyyy":((value.indexOf("/")>-1)?"mm/dd/yyyy":"yyyy-mm-dd");format.replace(/(yyyy|dd|mm)/g,function(part){fmt[part]=i++});minDateFormat=(minDate.indexOf(".")>-1)?"dd.mm.yyyy":((minDate.indexOf("/")>-1)?"mm/dd/yyyy":"yyyy-mm-dd");minDateFormat.replace(/(yyyy|dd|mm)/g,function(part){minDateFmt[part]=j++});var minDateParts=minDate.match(/(\d+)/g);var valueParts=value.match(/(\d+)/g);minDate=new Date(minDateParts[minDateFmt.yyyy],minDateParts[minDateFmt.mm]-1,minDateParts[minDateFmt.dd],0,0,0,0);if(options.shift){var shift=options.shift;day=minDate.getDate();day=day+parseInt(shift);minDate.setDate(day)}
value=new Date(valueParts[fmt.yyyy],valueParts[fmt.mm]-1,valueParts[fmt.dd],0,0,0,0);check=value<=minDate}
return this.optional(element)||check},function(options,element){if(options.fromField){var minDate="";var fieldId=options.value;var field=document.getElementById(fieldId);if(field){minDate=field.value}}else{minDate=options.value}
var format,minDateFormat,j=0,minDateFmt={},day,month,year,valDate;minDateFormat=(minDate.indexOf(".")>-1)?"dd.mm.yyyy":((minDate.indexOf("/")>-1)?"mm/dd/yyyy":"yyyy-mm-dd");minDateFormat.replace(/(yyyy|dd|mm)/g,function(part){minDateFmt[part]=j++});var minDateParts=minDate.match(/(\d+)/g);minDate=new Date(minDateParts[minDateFmt.yyyy],minDateParts[minDateFmt.mm]-1,minDateParts[minDateFmt.dd],0,0,0,0);if(options.shift){var shift=options.shift;day=minDate.getDate();day=day+parseInt(shift);minDate.setDate(day)}
format=options.format;valDate="";day=minDate.getDate();if(day<10){day="0"+day}
month=1+minDate.getMonth();if(month<10){month="0"+month}
year=minDate.getFullYear();switch(format){case "%Y-%m-%d":valDate=year+"-"+month+"-"+day;break;case "%m/%d/%Y":valDate=month+"/"+day+"/"+year;break;default:valDate=day+"."+month+"."+year;break}
return jQuery.validator.format("Das gewählte Datum darf höchstens {0} sein.",valDate)})})
Homepage von Lothar J. Ratschke Kyôshi:
Wir sind Mitglied im:
DKV
KDNW
LSB
KSB Rhein-Erft