Skip to content

Commit 8058e70

Browse files
author
Andreas Müller
committed
hack to get daily stats over multiple projects
1 parent fa6a879 commit 8058e70

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/output/table.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,37 @@ class table extends Base {
5757
this.write(mergeRequests.toString());
5858
}
5959

60+
makeDailyStats() {
61+
this.headline('DAILY RECORDS');
62+
63+
var tabledt = new Table({head: ['date', 'time']});
64+
var tabledit = new Table({head: ['date', 'project', 'iid', 'time']});
65+
let days = Object.keys(this.days);
66+
days.sort();
67+
days.forEach(
68+
k => {
69+
let day = this.days[k];
70+
let refD = this.daysMoment[k].format(this.config.get('dateFormat'));
71+
let projects = Object.keys(day);
72+
let time = 0;
73+
projects.forEach(
74+
p => {
75+
let iids = Object.keys(day[p]);
76+
iids.sort();
77+
iids.forEach(
78+
iid => {
79+
tabledit.push([refD, p, iid, this.config.toHumanReadable(day[p][iid], 'records')]);
80+
time += day[p][iid];
81+
});
82+
});
83+
tabledt.push([refD, this.config.toHumanReadable(time)]);
84+
});
85+
this.write(tabledt.toString());
86+
this.write(tabledit.toString());
87+
}
88+
6089
makeRecords() {
90+
this.makeDailyStats();
6191
this.headline('TIME RECORDS');
6292
let times = new Table({head: this.config.get('recordColumns').map(c => c.replace('_', ' '))});
6393
this.times.forEach(time => times.push(this.prepare(time, this.config.get('recordColumns'))));

0 commit comments

Comments
 (0)