In my opinion this is too much to do via a pipe, as it’s not terribly performant. I would instead group in your controller and then display that in your template.
Another note is that I’d recommend using date-fns instead of moment.js, as date-fns works with tree shaking resulting in a smaller bundle.
Honestly, Ionic is hard. A lot of people start here without much background, thinking it’s like Java. But you really ought to know the basics of Angular and Typescript before progamming in Ionic. So yeah, it will take some work before you can write performant code.
Ok I’ve now done the weekly grouping in PHP which returns the below Json,
"payload": {
"logs": {
"19": [
"[{\"entry\":"this is an entry",\"created\":\"2017-05-12 09:51:18\"}]"
],
"28": [
"[{\"entry\":"this is an entry",\"created\":\"2017-07-15 09:50:50\"}]",
"[{\"entry\":"this is an entry",\"created\":\"2017-07-15 09:51:18\"}]"
]
}
That error message seems strange, but fooling around with node, perhaps one may need to substitute Object.keys(weeks) where I initially had weeks.keys(). Oh JavaScript, how I despise thee.