Browse Source

Bugfix/time in market for impersonation mode (#6103)

* Fix time in market for impersonation mode

* Update changelog
pull/6114/head
Vahant Sharma 1 week ago
committed by GitHub
parent
commit
e668c6465e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 1
      apps/api/src/app/portfolio/portfolio.service.ts
  3. 11
      apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
  4. 6
      apps/client/src/app/services/data.service.ts
  5. 1
      libs/common/src/lib/interfaces/portfolio-summary.interface.ts

1
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

1
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,

11
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 = '-';
}

6
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;
})
);

1
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;

Loading…
Cancel
Save