|
|
@ -3,7 +3,7 @@ import { |
|
|
transformTickToAbbreviation |
|
|
transformTickToAbbreviation |
|
|
} from '@ghostfolio/common/chart-helper'; |
|
|
} from '@ghostfolio/common/chart-helper'; |
|
|
import { primaryColorRgb } from '@ghostfolio/common/config'; |
|
|
import { primaryColorRgb } from '@ghostfolio/common/config'; |
|
|
import { getLocale } from '@ghostfolio/common/helper'; |
|
|
import { getDateFnsLocale, getLocale } from '@ghostfolio/common/helper'; |
|
|
import { FireCalculationCompleteEvent } from '@ghostfolio/common/interfaces'; |
|
|
import { FireCalculationCompleteEvent } from '@ghostfolio/common/interfaces'; |
|
|
import { ColorScheme } from '@ghostfolio/common/types'; |
|
|
import { ColorScheme } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
|
@ -47,6 +47,7 @@ import { |
|
|
add, |
|
|
add, |
|
|
addDays, |
|
|
addDays, |
|
|
addYears, |
|
|
addYears, |
|
|
|
|
|
format, |
|
|
getMonth, |
|
|
getMonth, |
|
|
setMonth, |
|
|
setMonth, |
|
|
setYear, |
|
|
setYear, |
|
|
@ -235,6 +236,20 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy { |
|
|
this.calculatorForm.get('retirementDate').disable({ emitEvent: false }); |
|
|
this.calculatorForm.get('retirementDate').disable({ emitEvent: false }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public getFormattedRetirementDate(): string { |
|
|
|
|
|
const retirementDate = this.calculatorForm.get('retirementDate')?.value; |
|
|
|
|
|
|
|
|
|
|
|
if (!retirementDate) { |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const dateFnsLocale = getDateFnsLocale(this.locale); |
|
|
|
|
|
|
|
|
|
|
|
return format(retirementDate, 'MMMM yyyy', { |
|
|
|
|
|
locale: dateFnsLocale |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public setMonthAndYear( |
|
|
public setMonthAndYear( |
|
|
normalizedMonthAndYear: Date, |
|
|
normalizedMonthAndYear: Date, |
|
|
datepicker: MatDatepicker<Date> |
|
|
datepicker: MatDatepicker<Date> |
|
|
|