wip: split shared ops

This commit is contained in:
Matteo Pagliazzi
2016-03-07 23:02:42 +01:00
parent 8437c21a51
commit eeebe4c342
55 changed files with 1925 additions and 1634 deletions

View File

@@ -0,0 +1,14 @@
import moment from 'moment';
import _ from 'lodash';
/*
Preen 3-day past-completed To-Dos from Angular & mobile app
*/
module.exports = function(tasks) {
return _.filter(tasks, function(t) {
return !t.completed || (t.challenge && t.challenge.id) || moment(t.dateCompleted).isAfter(moment().subtract({
days: 3
}));
});
};