计算星期几的函数

$scope.getweekday = function (cdate) {
var arys1 = new Array();
arys1 = cdate.split('-'); //日期为输入日期,格式为 2013-3-10
var ssdate = new Date(arys1[0], parseInt(arys1[1] - 1), arys1[2]);
var week = ssdate.getDay() //就是你要的星期几
if (week != 0) {
return week;
}
return 7

}

 

posted on 2016-05-31 12:46  張暁磊  阅读(446)  评论(0编辑  收藏  举报