From 485ce08d99943ec083cfe6f36784403b32fbb5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 27 Sep 2023 17:01:02 +0300 Subject: [PATCH] RED-7641: Fixed current month not being displayed --- .../app/modules/admin/screens/license/utils/functions.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts b/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts index 1711451bc..107bcbf6b 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts @@ -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 = [];