Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/restrict retirement date picker of FIRE calculator to future dates (#5627)

Omar Eltomy244e63a127a7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2881c6ac92..d72c0bd84d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Restricted the selection of the retirement date picker in the _FIRE_ calculator to a future date
- Improved the support for mutual funds in the _Financial Modeling Prep_ service (get asset profiles)
- Improved the language localization for German (`de`)
- Upgraded `prisma` from version `6.16.1` to `6.16.3`
diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.component.html b/libs/ui/src/lib/fire-calculator/fire-calculator.component.html
index 60d5204e15..ef4722255c 100644
--- a/libs/ui/src/lib/fire-calculator/fire-calculator.component.html
+++ b/libs/ui/src/lib/fire-calculator/fire-calculator.component.html
@@ -40,6 +40,7 @@
formControlName="retirementDate"
matInput
[matDatepicker]="datepicker"
+ [min]="minDate"
/>
<mat-datepicker-toggle
matIconSuffix
diff --git a/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts b/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts
index 64fbe1b74f..df7ca79fad 100644
--- a/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts
+++ b/libs/ui/src/lib/fire-calculator/fire-calculator.component.ts
@@ -44,6 +44,7 @@ import 'chartjs-adapter-date-fns';
import Color from 'color';
import {
add,
+ addDays,
addYears,
getMonth,
setMonth,
@@ -102,6 +103,7 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
});
public chart: Chart<'bar'>;
public isLoading = true;
+ public minDate = addDays(new Date(), 1);
public periodsToRetire = 0;
private readonly CONTRIBUTION_PERIOD = 12;