Commit 9b881061 authored by Martin Wortschack's avatar Martin Wortschack Committed by Filipa Lacerda

Productivity Analytics: Fix date manipulation bug

parent bddcc578
...@@ -93,12 +93,8 @@ export const transformScatterData = (data, startDate, endDate) => { ...@@ -93,12 +93,8 @@ export const transformScatterData = (data, startDate, endDate) => {
Object.keys(data).forEach(id => { Object.keys(data).forEach(id => {
const mergedAtDate = new Date(data[id].merged_at); const mergedAtDate = new Date(data[id].merged_at);
const d = new Date(); const dayDiff = getDayDifference(mergedAtDate, endDate);
d.setDate(mergedAtDate.getDate());
d.setMonth(mergedAtDate.getMonth());
d.setFullYear(mergedAtDate.getFullYear());
const dayDiff = getDayDifference(d, endDate);
if (dayDiff > -1) { if (dayDiff > -1) {
const idx = totalItems - (dayDiff + 1); const idx = totalItems - (dayDiff + 1);
result[idx].push(data[id]); result[idx].push(data[id]);
......
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