Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2bb36a0f
Commit
2bb36a0f
authored
Aug 31, 2020
by
Brandon Labuschagne
Committed by
Martin Wortschack
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MR Analytics - Fix throughput chart date range calculation
parent
e492d82c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
ee/app/assets/javascripts/analytics/merge_request_analytics/utils.js
...ts/javascripts/analytics/merge_request_analytics/utils.js
+1
-1
ee/spec/frontend/analytics/merge_request_analytics/utils_spec.js
.../frontend/analytics/merge_request_analytics/utils_spec.js
+6
-3
No files found.
ee/app/assets/javascripts/analytics/merge_request_analytics/utils.js
View file @
2bb36a0f
...
...
@@ -25,7 +25,7 @@ export const computeMonthRangeData = (startDate, endDate, format = dateFormats.i
for
(
let
dateCursor
=
new
Date
(
endDate
);
dateCursor
>=
startDate
;
dateCursor
.
setMonth
(
dateCursor
.
getMonth
()
-
1
)
dateCursor
.
setMonth
(
dateCursor
.
getMonth
()
,
0
)
)
{
const
monthIndex
=
dateCursor
.
getMonth
();
const
year
=
dateCursor
.
getFullYear
();
...
...
ee/spec/frontend/analytics/merge_request_analytics/utils_spec.js
View file @
2bb36a0f
...
...
@@ -2,10 +2,13 @@ import * as utils from 'ee/analytics/merge_request_analytics/utils';
import
{
expectedMonthData
}
from
'
./mock_data
'
;
describe
(
'
computeMonthRangeData
'
,
()
=>
{
it
(
'
returns the data as expected
'
,
()
=>
{
const
startDate
=
new
Date
(
'
2020-05-17T00:00:00.000Z
'
);
const
endDate
=
new
Date
(
'
2020-07-17T00:00:00.000Z
'
);
const
start
=
new
Date
(
'
2020-05-17T00:00:00.000Z
'
);
it
.
each
`
startDate | endDate
${
start
}
|
${
new
Date
(
'
2020-07-17T00:00:00.000Z
'
)}
${
start
}
|
${
new
Date
(
'
2020-07-31T00:00:00.000Z
'
)}
`
(
'
returns the data as expected
'
,
({
startDate
,
endDate
})
=>
{
const
monthData
=
utils
.
computeMonthRangeData
(
startDate
,
endDate
);
expect
(
monthData
).
toStrictEqual
(
expectedMonthData
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment