Commit 73e13cbb authored by Yuri Mikhin's avatar Yuri Mikhin

Fix chart grouping by weeks.

parent fe554059
...@@ -149,6 +149,6 @@ function groupChartItemsByWeekNumber(items: Array<TimeChartItem>): Array<TimeCha ...@@ -149,6 +149,6 @@ function groupChartItemsByWeekNumber(items: Array<TimeChartItem>): Array<TimeCha
value: d3.sum(group, (d) => d.value), value: d3.sum(group, (d) => d.value),
dateLabel: `${ d3.timeFormat('%e %b %Y')(group[0].date) }${ d3.timeFormat('%e %b %Y')(group[group.length - 1].date) }`, dateLabel: `${ d3.timeFormat('%e %b %Y')(group[0].date) }${ d3.timeFormat('%e %b %Y')(group[group.length - 1].date) }`,
}), }),
(t) => dayjs(t.date).week(), (t) => `${ dayjs(t.date).week() } / ${ dayjs(t.date).year() }`,
).map(([ , v ]) => v); ).map(([ , v ]) => v);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment