diff --git a/CHANGELOG.md b/CHANGELOG.md index 843152af3..28bd529d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Added the missing currency suffix to the cash balance field in the create or update account dialog +- Fixed the time in market display of the portfolio summary tab on the home page for the impersonation mode - Fixed the delete button in the asset profile details dialog of the admin control panel by providing the missing `watchedByCount` parameter ## 2.224.2 - 2025-12-20 diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 084c8f4ed..faabee79b 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1954,6 +1954,7 @@ export class PortfolioService { }).length, committedFunds: committedFunds.toNumber(), currentValueInBaseCurrency: currentValueInBaseCurrency.toNumber(), + dateOfFirstActivity: firstOrderDate, dividendInBaseCurrency: dividendInBaseCurrency.toNumber(), emergencyFund: { assets: emergencyFundHoldingsValueInBaseCurrency, diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts index 9e9bb13d3..78ccce1ed 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts @@ -84,10 +84,13 @@ export class GfPortfolioSummaryComponent implements OnChanges { this.precision = 0; } - if (this.user.dateOfFirstActivity) { - this.timeInMarket = formatDistanceToNow(this.user.dateOfFirstActivity, { - locale: getDateFnsLocale(this.language) - }); + if (this.summary.dateOfFirstActivity) { + this.timeInMarket = formatDistanceToNow( + this.summary.dateOfFirstActivity, + { + locale: getDateFnsLocale(this.language) + } + ); } else { this.timeInMarket = '-'; } diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 4c324fe03..31b0fef73 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -564,6 +564,12 @@ export class DataService { } } + if (response.summary?.dateOfFirstActivity) { + response.summary.dateOfFirstActivity = parseISO( + response.summary.dateOfFirstActivity + ); + } + return response; }) ); diff --git a/libs/common/src/lib/interfaces/portfolio-summary.interface.ts b/libs/common/src/lib/interfaces/portfolio-summary.interface.ts index f08eb61b8..ccf94dcf7 100644 --- a/libs/common/src/lib/interfaces/portfolio-summary.interface.ts +++ b/libs/common/src/lib/interfaces/portfolio-summary.interface.ts @@ -7,6 +7,7 @@ export interface PortfolioSummary extends PortfolioPerformance { annualizedPerformancePercentWithCurrencyEffect: number; cash: number; committedFunds: number; + dateOfFirstActivity: Date; dividendInBaseCurrency: number; emergencyFund: { assets: number;