|
|
@ -53,6 +53,7 @@ import { |
|
|
isBefore, |
|
|
isBefore, |
|
|
isWithinInterval, |
|
|
isWithinInterval, |
|
|
min, |
|
|
min, |
|
|
|
|
|
startOfDay, |
|
|
startOfYear, |
|
|
startOfYear, |
|
|
subDays |
|
|
subDays |
|
|
} from 'date-fns'; |
|
|
} from 'date-fns'; |
|
|
@ -162,8 +163,8 @@ export abstract class PortfolioCalculator { |
|
|
subDays(dateOfFirstActivity, 1) |
|
|
subDays(dateOfFirstActivity, 1) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
this.endDate = endDate; |
|
|
this.endDate = endOfDay(endDate); |
|
|
this.startDate = startDate; |
|
|
this.startDate = startOfDay(startDate); |
|
|
|
|
|
|
|
|
this.computeTransactionPoints(); |
|
|
this.computeTransactionPoints(); |
|
|
|
|
|
|
|
|
@ -236,7 +237,7 @@ export abstract class PortfolioCalculator { |
|
|
const exchangeRatesByCurrency = |
|
|
const exchangeRatesByCurrency = |
|
|
await this.exchangeRateDataService.getExchangeRatesByCurrency({ |
|
|
await this.exchangeRateDataService.getExchangeRatesByCurrency({ |
|
|
currencies: Array.from(new Set(Object.values(currencies))), |
|
|
currencies: Array.from(new Set(Object.values(currencies))), |
|
|
endDate: endOfDay(this.endDate), |
|
|
endDate: this.endDate, |
|
|
startDate: this.startDate, |
|
|
startDate: this.startDate, |
|
|
targetCurrency: this.currency |
|
|
targetCurrency: this.currency |
|
|
}); |
|
|
}); |
|
|
|