Skip to content
Snippets Groups Projects

DOS0089064

Merged Dimitri DI GUSTO requested to merge DOS0089064 into master
2 files
+ 5
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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.getFullYear()}-${`0${today.getMonth()}`.slice(-2)}-${today.getDate()}`;
today.setMonth(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