Browse Source
Bugfix/expand date range to cover full day in exchange rate calculation (#6311)
* Expand date range (start to end of day)
* Update changelog
pull/6312/head
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
|
|
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue in the annualized performance calculation |
|
|
|
- Fixed an issue with the exchange rate calculation by expanding the date range to cover the full day (start to end of day) |
|
|
|
|
|
|
|
## 2.237.0 - 2026-02-08 |
|
|
|
|
|
|
|
|
|
|
|
@ -53,6 +53,7 @@ import { |
|
|
|
isBefore, |
|
|
|
isWithinInterval, |
|
|
|
min, |
|
|
|
startOfDay, |
|
|
|
startOfYear, |
|
|
|
subDays |
|
|
|
} from 'date-fns'; |
|
|
|
@ -162,8 +163,8 @@ export abstract class PortfolioCalculator { |
|
|
|
subDays(dateOfFirstActivity, 1) |
|
|
|
); |
|
|
|
|
|
|
|
this.endDate = endDate; |
|
|
|
this.startDate = startDate; |
|
|
|
this.endDate = endOfDay(endDate); |
|
|
|
this.startDate = startOfDay(startDate); |
|
|
|
|
|
|
|
this.computeTransactionPoints(); |
|
|
|
|
|
|
|
@ -236,7 +237,7 @@ export abstract class PortfolioCalculator { |
|
|
|
const exchangeRatesByCurrency = |
|
|
|
await this.exchangeRateDataService.getExchangeRatesByCurrency({ |
|
|
|
currencies: Array.from(new Set(Object.values(currencies))), |
|
|
|
endDate: endOfDay(this.endDate), |
|
|
|
endDate: this.endDate, |
|
|
|
startDate: this.startDate, |
|
|
|
targetCurrency: this.currency |
|
|
|
}); |
|
|
|
|