RED-7641: Fixed current month not being displayed

This commit is contained in:
Adina Țeudan 2023-09-27 17:01:02 +03:00
parent b97a8dc1f9
commit 485ce08d99

View File

@ -1,7 +1,7 @@
import dayjs, { Dayjs } from 'dayjs';
import { FillTarget } from 'chart.js';
import { hexToRgba } from '@utils/functions';
import { ILicenseData, ILicenseReport } from '@red/domain';
import { ILicenseReport } from '@red/domain';
import { ComplexFillTarget } from 'chart.js/dist/types';
const monthNames = dayjs.monthsShort();
@ -31,11 +31,9 @@ export const getLineConfig: (
pointStyle: false,
});
export const getLabelsFromMonthlyData = (monthlyData: ILicenseData[]) => monthlyData.map(data => verboseDate(dayjs(data.startDate)));
export const getLabelsFromLicense = (license: ILicenseReport) => {
let startMonth = dayjs(license.startDate);
const endMonth = dayjs(license.endDate);
let startMonth = dayjs(license.startDate).startOf('month');
const endMonth = dayjs(license.endDate).endOf('month');
const result = [];