通过日期获得星期方法

//获取星期
function getWeek(dateString) {
    var date;
    if (isNull(dateString)) {
        date = new Date();
    } else {
        var dateArray = dateString.split("-");
        date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
    }
    return "星期" + "日一二三四五六".charAt(date.getDay());
};
function isNull(object) {
    if (object == null || typeof object == "undefined") {
        return true;
    }
    return false;
};
原文地址:https://www.cnblogs.com/Allofus/p/15064452.html