/**
* 求该天属于星期几
* @param {*} dateString 日期
*/
function getWeek(dateString) {
var date;
var dateArray = dateString.split("-");
date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
return "日一二三四五六".charAt(date.getDay());
};
/**
* 求该天属于星期几
* @param {*} dateString 日期
*/
function getWeek(dateString) {
var date;
var dateArray = dateString.split("-");
date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
return "日一二三四五六".charAt(date.getDay());
};
本文标题:js求该天属于星期几
本文链接:https://www.haomeiwen.com/subject/grszlqtx.html
网友评论