From 3f6d99b753b4156fda0f0339a971e95ac5223653 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:34:28 +0200 Subject: [PATCH] Migrate from "in" to "gte" and "lt" --- .../src/app/portfolio/current-rate.service.mock.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/api/src/app/portfolio/current-rate.service.mock.ts b/apps/api/src/app/portfolio/current-rate.service.mock.ts index 8ac1d15bd..9746f3180 100644 --- a/apps/api/src/app/portfolio/current-rate.service.mock.ts +++ b/apps/api/src/app/portfolio/current-rate.service.mock.ts @@ -1,6 +1,12 @@ import { parseDate, resetHours } from '@ghostfolio/common/helper'; -import { addDays, endOfDay, isBefore, isSameDay } from 'date-fns'; +import { + addDays, + eachDayOfInterval, + endOfDay, + isBefore, + isSameDay +} from 'date-fns'; import { GetValueObject } from './interfaces/get-value-object.interface'; import { GetValuesObject } from './interfaces/get-values-object.interface'; @@ -97,7 +103,10 @@ export const CurrentRateServiceMock = { } } } else { - for (const date of dateQuery.in) { + for (const date of eachDayOfInterval({ + end: dateQuery.lt, + start: dateQuery.gte + })) { for (const dataGatheringItem of dataGatheringItems) { values.push({ date,