在 Ember 中,很容易过滤要查找匹配值的数组(仅返回 name == "John),我不知道如何使用大于或小于进行过滤(返回所有对象)谁的开始日期在今天之前
在我的应用程序中,我有一组可交付成果。我想将这些可交付成果分为三类:十天内到期、逾期,然后是其余的。
我在另一篇 SO 帖子中找到了以下示例,但不知道如何使用它来实现我的目标
filterComputed: function() {
return this.get('content').filter(function(item, index, enumerable){
return item.firstName == 'Luke';
});
}.property('content.@each')
最佳答案
你可以这样做:
this.get('content').filter(function(item){
return item.get('someProperty') > someVar;
});
关于date - 按日期范围过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23415599/