获取今年第一周时间

2021年11月11日 | 分类: js | 评论: 0 | 浏览: 827
var one_day = function(){
	var f = function(d){
		if(d.getDay() == 0){
			return d;
		}else{
			d.setDate(d.getDate()+1)
			return f(d);
		}
	}
	var onezhou = new Date()
	onezhou.setMonth(0)
	onezhou.setDate(1)
	f(onezhou)
	return onezhou;
}


顶一下 ▲()
踩一下 ▼()
发表留言
登录后才能发表留言,立即 登录注册
提交 (Ctrl+Enter)
Copyright 2020-2024 xaoi博客 All Rights Reserved.