Browse Source
Fix group by month/year not working for YTD (#1598)
* Set time to 00:00:00 when getting current timestamp
* Update changelog
pull/1603/head
Yash Solanki
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
24 additions and
5 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.service.ts
-
apps/client/src/app/components/investment-chart/investment-chart.component.ts
|
@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
|
- Improved the logo alignment |
|
|
- Improved the logo alignment |
|
|
|
|
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
|
|
|
|
- Fixed the grouping by month / year of the dividend and investment timeline |
|
|
|
|
|
|
|
|
## 1.226.0 - 2023-01-11 |
|
|
## 1.226.0 - 2023-01-11 |
|
|
|
|
|
|
|
|
### Added |
|
|
### Added |
|
|
|
@ -1468,16 +1468,28 @@ export class PortfolioService { |
|
|
private getStartDate(aDateRange: DateRange, portfolioStart: Date) { |
|
|
private getStartDate(aDateRange: DateRange, portfolioStart: Date) { |
|
|
switch (aDateRange) { |
|
|
switch (aDateRange) { |
|
|
case '1d': |
|
|
case '1d': |
|
|
portfolioStart = max([portfolioStart, subDays(new Date(), 1)]); |
|
|
portfolioStart = max([ |
|
|
|
|
|
portfolioStart, |
|
|
|
|
|
subDays(new Date().setHours(0, 0, 0, 0), 1) |
|
|
|
|
|
]); |
|
|
break; |
|
|
break; |
|
|
case 'ytd': |
|
|
case 'ytd': |
|
|
portfolioStart = max([portfolioStart, setDayOfYear(new Date(), 1)]); |
|
|
portfolioStart = max([ |
|
|
|
|
|
portfolioStart, |
|
|
|
|
|
setDayOfYear(new Date().setHours(0, 0, 0, 0), 1) |
|
|
|
|
|
]); |
|
|
break; |
|
|
break; |
|
|
case '1y': |
|
|
case '1y': |
|
|
portfolioStart = max([portfolioStart, subYears(new Date(), 1)]); |
|
|
portfolioStart = max([ |
|
|
|
|
|
portfolioStart, |
|
|
|
|
|
subYears(new Date().setHours(0, 0, 0, 0), 1) |
|
|
|
|
|
]); |
|
|
break; |
|
|
break; |
|
|
case '5y': |
|
|
case '5y': |
|
|
portfolioStart = max([portfolioStart, subYears(new Date(), 5)]); |
|
|
portfolioStart = max([ |
|
|
|
|
|
portfolioStart, |
|
|
|
|
|
subYears(new Date().setHours(0, 0, 0, 0), 5) |
|
|
|
|
|
]); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
return portfolioStart; |
|
|
return portfolioStart; |
|
|
|
@ -196,7 +196,10 @@ export class InvestmentChartComponent implements OnChanges, OnDestroy { |
|
|
this.getTooltipPluginConfiguration() |
|
|
this.getTooltipPluginConfiguration() |
|
|
); |
|
|
); |
|
|
this.chart.options.scales.x.min = this.daysInMarket |
|
|
this.chart.options.scales.x.min = this.daysInMarket |
|
|
? subDays(new Date(), this.daysInMarket).toISOString() |
|
|
? subDays( |
|
|
|
|
|
new Date().setHours(0, 0, 0, 0), |
|
|
|
|
|
this.daysInMarket |
|
|
|
|
|
).toISOString() |
|
|
: undefined; |
|
|
: undefined; |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|