Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Merge requests
!112
DOS0089064
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
DOS0089064
DOS0089064
into
master
Overview
0
Commits
2
Pipelines
0
Changes
2
Merged
Dimitri DI GUSTO
requested to merge
DOS0089064
into
master
4 years ago
Overview
0
Commits
2
Pipelines
0
Changes
2
Expand
Fix dataset usage statistics query
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
92cdb9e4
2 commits,
4 years ago
2 files
+
5
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/app/dataset-detail/services/usage-statistics.service.ts
+
4
−
4
Options
@@ -19,12 +19,12 @@ export class UsageStatisticsService {
// However the months in javascript dates goes from 0 to 11 so when passing start and end dates, we don't need to subsctract a month
// The backend service expect a 2 digits month while javascript date does not give 'O1' but only '1'. This is while we use a small trick
// to make sure there always two digits for the month in the date
const
monthListArray
=
[
'
01
'
,
'
02
'
,
'
03
'
,
'
04
'
,
'
05
'
,
'
06
'
,
'
07
'
,
'
08
'
,
'
09
'
,
'
10
'
,
'
11
'
,
'
12
'
];
const
today
=
new
Date
();
const
aMonthAgo
=
`
${
today
.
g
et
FullYear
()}
-
${
`0
${
today
.
getMonth
()}
`
.
slice
(
-
2
)}
-
${
today
.
getDate
()}
`
;
today
.
s
et
Month
(
today
.
getMonth
()
-
1
)
;
const
aMonthAgo
=
`
${
today
.
getFullYear
()}
-
${
monthListArray
[
today
.
getMonth
()]}
-
${
today
.
getDate
()}
`
;
today
.
setFullYear
(
today
.
getFullYear
()
-
1
);
const
aMonthAndAYearAgo
=
`
${
today
.
getFullYear
()}
-
${
`0
${
today
.
getMonth
()}
`
.
slice
(
-
2
)}
-
${
today
.
getDate
()}
`
;
const
aMonthAndAYearAgo
=
`
${
today
.
getFullYear
()}
-
${
monthListArray
[
today
.
getMonth
()]}
-
${
today
.
getDate
()}
`
;
const
url
=
`
${
APP_CONFIG
.
backendUrls
.
datasetUsageStatistics
}
?start=
${
aMonthAndAYearAgo
}
&uuid=
${
uuid
}
&granularity=month&end=
${
aMonthAgo
}
`
;
return
this
.
_httpClient
.
get
(
url
).
pipe
(
Loading