Last active
August 29, 2015 13:56
-
-
Save guilbep/9073032 to your computer and use it in GitHub Desktop.
New property for each day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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