js 根据日期判断星期几

var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];  
var myDate = new Date(Date.parse("2018/5/19"));  
console.log(weekDay[myDate.getDay()]);    // 星期六
posted @ 2019-12-24 21:59  写手在作画  阅读(1729)  评论(0编辑  收藏  举报