Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb/pull/214#discussion_r11811097
--- Diff: src/fauxton/app/addons/logs/resources.js ---
@@ -110,7 +119,28 @@ function (app, FauxtonAPI, Backbone, d3) {
},
serialize: function () {
- return { logs: new Log.Collection(this.createFilteredCollection())};
+ var collection = new Log.Collection(this.createFilteredCollection());
+
+ return {
+ days: this.sortLogsIntoDays(collection)
+ };
+ },
+
+ sortLogsIntoDays: function (collection) {
+ var sortedCollection = {},
+ date = null;
+
+ collection.each(function (log) {
--- End diff --
You can use `_.reduce` instead of `.each` it will make it much neater and
require less variables. We use _.reduce in a couple places, so you can grep for
some examples.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---