diff --git a/libs/ui/src/lib/assistant/assistant.component.ts b/libs/ui/src/lib/assistant/assistant.component.ts index e9c6e77b3..7bbc3978c 100644 --- a/libs/ui/src/lib/assistant/assistant.component.ts +++ b/libs/ui/src/lib/assistant/assistant.component.ts @@ -33,7 +33,7 @@ import { MatSelectModule } from '@angular/material/select'; import { RouterModule } from '@angular/router'; import { IonIcon } from '@ionic/angular/standalone'; import { AssetClass, DataSource } from '@prisma/client'; -import { differenceInYears } from 'date-fns'; +import { differenceInYears, eachYearOfInterval, format } from 'date-fns'; import Fuse from 'fuse.js'; import { addIcons } from 'ionicons'; import { @@ -389,20 +389,19 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { }); } - // TODO - // if (this.user?.settings?.isExperimentalFeatures) { - // this.dateRangeOptions = this.dateRangeOptions.concat( - // eachYearOfInterval({ - // end: new Date(), - // start: this.user?.dateOfFirstActivity ?? new Date() - // }) - // .map((date) => { - // return { label: format(date, 'yyyy'), value: format(date, 'yyyy') }; - // }) - // .slice(0, -1) - // .reverse() - // ); - // } + if (this.user?.settings?.isExperimentalFeatures) { + this.dateRangeOptions = this.dateRangeOptions.concat( + eachYearOfInterval({ + end: new Date(), + start: this.user?.dateOfFirstActivity ?? new Date() + }) + .map((date) => { + return { label: format(date, 'yyyy'), value: format(date, 'yyyy') }; + }) + .slice(0, -1) + .reverse() + ); + } if ( this.user?.dateOfFirstActivity &&