判断日期是周几

getWeek(dates){
    let arys1 =dates.split('-'); //日期为输入日期,格式为 2013-3-10
    let ssdate = new Date(arys1[0], parseInt(arys1[1] - 1), arys1[2]);
    let week = String(ssdate.getDay()).replace("0", "日").replace("1", "一").replace("2", "二").replace("3",
        "三").replace("4", "四").replace("5", "五").replace("6", "六")
   console.log(week); },

 

posted @ 2021-04-02 17:59  面包不甜  阅读(166)  评论(2编辑  收藏  举报