ITeye博客

自定义获取指定日期

ausdin · 2011-10-27 16:25 · JS · Web前端 · js 指定日期 · Markdown


//获取day天后的日期:格式为2010-1-1
Date.prototype.calculateDate = function(day) {
	this.setDate(this.getDate() + day);  //计算新日期
	return this.getFullYear() + '-' + (this.getMonth() + 1) + '-' + this.getDate();
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。