angular 时间戳转换(星期过滤器)

{{(value.time+'000' | date:'yyyy-MM-dd HH:mm:ss') : '/'}}

.filter('getWeek', function() {
return function(input) {
var date = new Date(input * 1000);
var week = date.getDay();
switch (week) {
case 0:
return "星期天";
break;
case 1:
return "星期一";
break;
case 2:
return "星期二";
break;
case 3:
return "星期三";
break;
case 4:
return "星期四";
break;
case 5:
return "星期五";
break;
case 6:
return "星期六";
break;
}
}

})

 

posted @ 2017-09-19 20:54  abcByme  阅读(697)  评论(0编辑  收藏  举报