Skip to content

Instantly share code, notes, and snippets.

@guilbep
Last active August 29, 2015 13:56
Show Gist options
  • Save guilbep/9073032 to your computer and use it in GitHub Desktop.
Save guilbep/9073032 to your computer and use it in GitHub Desktop.
New property for each day
module.filter('setDayApart', function() {
return function(input) {
var res = [];
var dayBefore;
angular.forEach(input, function(row, key) {
if (row.day !== dayBefore) {
row.newDay = true;
}
res.push(row);
dayBefore = row.day;
});
return res;
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment