
function compareDate(date1,date2){
year1=date1.substring(0,date1.indexOf("-"));
year2=date2.substring(0,date2.indexOf("-"));
month1=date1.substring(date1.indexOf("-")+1,date1.lastIndexOf("-"));
month2=date2.substring(date2.indexOf("-")+1,date2.lastIndexOf("-"));
day1=date1.substring(date1.lastIndexOf("-")+1,date1.indexOf("h"));
day2=date2.substring(date2.lastIndexOf("-")+1,date2.indexOf("h"));
if(parseInt(year1)>parseInt(year2)){
return 0;}else if(parseInt(month1)>parseInt(month2)){
return 0;}else if(parseInt(day1)>parseInt(day2)){
return 0;}
return 1;}
function getNowFormatDate(){
var day=new Date();
var Year=0;
var Month=0;
var Day=0;
var CurrentDate="";
Year=day.getFullYear();
Month=day.getMonth()+1;
Day=day.getDate();
CurrentDate+=Year+"-";
if(Month>=10){
CurrentDate+=Month+"-";}
else{
CurrentDate+="0"+Month+"-";}
if(Day>=10){
CurrentDate+=Day;}
else{
CurrentDate+="0"+Day;}
return CurrentDate;}
function jsCompareDate(sdate,edate){
var startDate=new Date(sdate.replace("-",",")).getTime();
var endDate=new Date(edate.replace("-",",")).getTime();
if(startDate>endDate){
return false;}
return true;}

