var arr = new Array();
if(dateval.indexOf("-") != -1){
arr = dateval.toString().split("-");
}else if(dateval.indexOf("/") != -1){
arr = dateval.toString().split("/");
}else{
return false;
}
//yyyy-mm-dd || yyyy/mm/dd
if(arr[0].length==4){
var date = new Date(arr[0],arr[1]-1,arr[2]);
if(date.getFullYear()==arr[0] && date.getMonth()==arr[1]-1 && date.getDate()==arr[2]){
return true;
}
}
//dd-mm-yyyy || dd/mm/yyyy
if(arr[2].length==4){
var date = new Date(arr[2],arr[1]-1,arr[0]);
if(date.getFullYear()==arr[2] && date.getMonth()==arr[1]-1 && date.getDate()==arr[0]){
return true;
}
}
//mm-dd-yyyy || mm/dd/yyyy
if(arr[2].length==4){
var date = new Date(arr[2],arr[0]-1,arr[1]);
if(date.getFullYear()==arr[2] && date.getMonth()==arr[0]-1 && date.getDate()==arr[1]){
return true;
}
}
return false;
}