1、获取当天是星期几,则为:
new Date().getDay();
2、给定日期是星期几,应把字符串转为Date:
new.Date('2017-12-30').getDay();
// 返回0,表示星期天,1:星期一……
注意:考虑ios、android兼容性问题,建议字符串'2017-12-30'先转为标准的“2017/12/30”,再处理
转载于:https://www.cnblogs.com/queende7/p/8668905.html