var days = '天一二三四五六';
if(str.indexOf("-")) {
var f = str.replace(/-/g,'/');
}
f = new Date(f).getDay();//getDay() 返回星期几
return '星期'+ days.split('')[f];
}
alert(get_day('2017-2-23'));```
var days = '天一二三四五六';
if(str.indexOf("-")) {
var f = str.replace(/-/g,'/');
}
f = new Date(f).getDay();//getDay() 返回星期几
return '星期'+ days.split('')[f];
}
alert(get_day('2017-2-23'));```
本文标题:根据日期求星期几
本文链接:https://www.haomeiwen.com/subject/xwobwttx.html
网友评论