Commit c684b6b0 authored by Martin Wortschack's avatar Martin Wortschack Committed by Kushal Pandya

Use datetime instead of date

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