import cnode from '../cnode'

cnode.filter('diffDate', [() => {
	return (date) => {
		let diff = (Date.now() - (new Date(date).getTime())) / 1000
		switch(true) {
			case diff < 0:
				return '现在'
			case (diff/=60) < 1:
				return parseInt(diff*60) + ' 秒以前'
			case (diff/=60) < 1:
				return parseInt(diff*60) + ' 分钟以前'
			case (diff/=24) < 1:
				return parseInt(diff*24) + ' 小时以前'
			case (diff/=30) < 1:
				return parseInt(diff*30) + ' 天以前'
			case (diff/=12) < 1:
				return parseInt(diff*12) + ' 月以前'
			default:
				return parseInt(diff) + ' 年以前'
		}
	}
}])
@@ -517,32 +517,33 @@
 ult:%0A%09%09%09%09return 
+(
 parseInt(diff) +
@@ -540,16 +540,22 @@
 nt(diff)
+ %7C%7C 0)
  + ' %E5%B9%B4%E4%BB%A5%E5%89%8D

fix NaN error