Commit b34a6447 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'mw-pa-transform-scatter-data-fix' into 'master'

Productivity Analytics: Fix date manipulation bug

See merge request gitlab-org/gitlab!20457
parents bddcc578 9b881061
...@@ -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