Array.prototype.Contains=function(obj)
{
if(null==obj){return;}
for(var i=0;i<this.length;i++)
{
if(this[i]==obj)
{
return true;
}
}
return false;
}
Date.prototype.toCriterionString=function(){
var month = this.getMonth() + 1;
month = month > 9 ? month : "0"+month;
var date = this.getDate() > 9 ? this.getDate() : "0" + this.getDate();
return this.getYear() + "-" + month + "-" + date;
}
Date.prototype.toFullString=function(onlyTime){
var result = onlyTime ? "" : this.toCriterionString() + " ";
var hours = this.getHours() > 9 ? this.getHours() : "0" + this.getHours();
var minutes = this.getMinutes() > 9 ? this.getMinutes() : "0" + this.getMinutes();
var second = this.getSeconds()>9 ? this.getSeconds(): "0" + this.getSeconds();
if(second && second!=00){
return result + hours + ":" + minutes + ":" + second;
}else{
return result + hours + ":" + minutes;
}
}
自定义object[url]http://www.ccvita.com/94.html[/url]