Thomas Kaul
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
22 additions and
10 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/calculator/roai/portfolio-calculator.ts
|
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. |
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Restored the support for specific calendar year date ranges (`2024`, `2023`, `2022`, etc.) in the holdings table (experimental) |
|
|
|
|
|
|
|
## 2.229.0 - 2026-01-11 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
@ -13,7 +13,14 @@ import { PerformanceCalculationType } from '@ghostfolio/common/types/performance |
|
|
|
|
|
|
|
import { Logger } from '@nestjs/common'; |
|
|
|
import { Big } from 'big.js'; |
|
|
|
import { addMilliseconds, differenceInDays, format, isBefore } from 'date-fns'; |
|
|
|
import { |
|
|
|
addMilliseconds, |
|
|
|
differenceInDays, |
|
|
|
eachYearOfInterval, |
|
|
|
format, |
|
|
|
isBefore, |
|
|
|
isThisYear |
|
|
|
} from 'date-fns'; |
|
|
|
import { cloneDeep, sortBy } from 'lodash'; |
|
|
|
|
|
|
|
export class RoaiPortfolioCalculator extends PortfolioCalculator { |
|
|
|
@ -837,15 +844,14 @@ export class RoaiPortfolioCalculator extends PortfolioCalculator { |
|
|
|
'max', |
|
|
|
'mtd', |
|
|
|
'wtd', |
|
|
|
'ytd' |
|
|
|
// TODO:
|
|
|
|
// ...eachYearOfInterval({ end, start })
|
|
|
|
// .filter((date) => {
|
|
|
|
// return !isThisYear(date);
|
|
|
|
// })
|
|
|
|
// .map((date) => {
|
|
|
|
// return format(date, 'yyyy');
|
|
|
|
// })
|
|
|
|
'ytd', |
|
|
|
...eachYearOfInterval({ end, start }) |
|
|
|
.filter((date) => { |
|
|
|
return !isThisYear(date); |
|
|
|
}) |
|
|
|
.map((date) => { |
|
|
|
return format(date, 'yyyy'); |
|
|
|
}) |
|
|
|
] as DateRange[]) { |
|
|
|
const dateInterval = getIntervalFromDateRange(dateRange); |
|
|
|
const endDate = dateInterval.endDate; |
|
|
|
|