Commit b96a8fba authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'mw-productivity-analytics-add-time-portion-to-date' into 'master'

Productivity Analytics: Use datetime for merged_at_after and merged_at_before

Closes #33350

See merge request gitlab-org/gitlab!18150
parents 7c6e27fa c684b6b0
...@@ -561,3 +561,6 @@ export const getDateInPast = (date, daysInPast) => { ...@@ -561,3 +561,6 @@ export const getDateInPast = (date, daysInPast) => {
dateClone.setTime(dateClone.getTime() - daysInPast * 24 * 60 * 60 * 1000), dateClone.setTime(dateClone.getTime() - daysInPast * 24 * 60 * 60 * 1000),
).toISOString(); ).toISOString();
}; };
export const beginOfDayTime = 'T00:00:00Z';
export const endOfDayTime = 'T23:59:59Z';
import dateFormat from 'dateformat'; import dateFormat from 'dateformat';
import { urlParamsToObject } from '~/lib/utils/common_utils'; import { urlParamsToObject } from '~/lib/utils/common_utils';
import { getDateInPast } from '~/lib/utils/datetime_utility'; import { getDateInPast, beginOfDayTime, endOfDayTime } from '~/lib/utils/datetime_utility';
import { chartKeys, scatterPlotAddonQueryDays } from '../../../constants'; import { chartKeys, scatterPlotAddonQueryDays } from '../../../constants';
import { dateFormats } from '../../../../shared/constants'; import { dateFormats } from '../../../../shared/constants';
...@@ -15,8 +15,8 @@ import { dateFormats } from '../../../../shared/constants'; ...@@ -15,8 +15,8 @@ import { dateFormats } from '../../../../shared/constants';
* author_username: 'author', * author_username: 'author',
* milestone_title: 'my milestone', * milestone_title: 'my milestone',
* label_name: ['my label', 'yet another label'], * label_name: ['my label', 'yet another label'],
* merged_at_after: '2019-06-11' * merged_at_after: '2019-06-11T00:00:00Z'
* merged_at_before: '2019-09-09' * merged_at_before: '2019-09-09T23:59:59Z'
* } * }
* *
*/ */
...@@ -39,8 +39,8 @@ export const getCommonFilterParams = state => chartKey => { ...@@ -39,8 +39,8 @@ export const getCommonFilterParams = state => chartKey => {
author_username, author_username,
milestone_title, milestone_title,
label_name, label_name,
merged_at_after: mergedAtAfterDate, merged_at_after: `${mergedAtAfterDate}${beginOfDayTime}`,
merged_at_before: dateFormat(endDate, dateFormats.isoDate), merged_at_before: `${dateFormat(endDate, dateFormats.isoDate)}${endOfDayTime}`,
}; };
}; };
......
...@@ -29,8 +29,8 @@ describe('Productivity analytics filter getters', () => { ...@@ -29,8 +29,8 @@ describe('Productivity analytics filter getters', () => {
author_username: 'root', author_username: 'root',
group_id: 'gitlab-org', group_id: 'gitlab-org',
label_name: ['labelxyz'], label_name: ['labelxyz'],
merged_at_after: '2019-09-01', merged_at_after: '2019-09-01T00:00:00Z',
merged_at_before: '2019-09-07', merged_at_before: '2019-09-07T23:59:59Z',
milestone_title: 'foo', milestone_title: 'foo',
project_id: 'gitlab-org/gitlab-test', project_id: 'gitlab-org/gitlab-test',
}; };
...@@ -47,8 +47,8 @@ describe('Productivity analytics filter getters', () => { ...@@ -47,8 +47,8 @@ describe('Productivity analytics filter getters', () => {
author_username: 'root', author_username: 'root',
group_id: 'gitlab-org', group_id: 'gitlab-org',
label_name: ['labelxyz'], label_name: ['labelxyz'],
merged_at_after: '2019-08-02', merged_at_after: '2019-08-02T00:00:00Z',
merged_at_before: '2019-09-07', merged_at_before: '2019-09-07T23:59:59Z',
milestone_title: 'foo', milestone_title: 'foo',
project_id: 'gitlab-org/gitlab-test', project_id: 'gitlab-org/gitlab-test',
}; };
......
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