diff --git a/CHANGELOG.md b/CHANGELOG.md index 509009e6f..0df434951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed the check for duplicates in the preview step of the activities import for activities without a comment - Fixed the holdings mock data in the _Storybook_ story of the portfolio filter form component +- Fixed the date normalization in the market data update endpoint to prevent duplicate entries on servers running in a non-UTC time zone ## 3.44.0 - 2026-08-07 diff --git a/apps/api/src/app/endpoints/market-data/market-data.controller.ts b/apps/api/src/app/endpoints/market-data/market-data.controller.ts index 03d50c284..8ce44780e 100644 --- a/apps/api/src/app/endpoints/market-data/market-data.controller.ts +++ b/apps/api/src/app/endpoints/market-data/market-data.controller.ts @@ -4,7 +4,12 @@ import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard' import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service'; import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; import { UpdateBulkMarketDataDto } from '@ghostfolio/common/dtos'; -import { getCurrencyFromSymbol, isCurrency } from '@ghostfolio/common/helper'; +import { + getCurrencyFromSymbol, + isCurrency, + parseDate, + resetHours +} from '@ghostfolio/common/helper'; import { MarketDataOfMarketsResponse } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { RequestWithUser } from '@ghostfolio/common/types'; @@ -24,7 +29,6 @@ import { import { REQUEST } from '@nestjs/core'; import { AuthGuard } from '@nestjs/passport'; import { DataSource, Prisma } from '@prisma/client'; -import { parseISO } from 'date-fns'; import { getReasonPhrase, StatusCodes } from 'http-status-codes'; @Controller('market-data') @@ -99,7 +103,7 @@ export class MarketDataController { dataSource, marketPrice, symbol, - date: parseISO(date), + date: resetHours(parseDate(date)), state: 'CLOSE' }) );