Browse Source

Feature/restore support for specific calendar year date ranges in assistant (#6079)

* Restore specific calendar year date ranges

* Update changelog
pull/6068/head
Thomas Kaul 19 hours ago
committed by GitHub
parent
commit
5102e1a3a9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 29
      libs/ui/src/lib/assistant/assistant.component.ts

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Restored the support for specific calendar year date ranges (`2024`, `2023`, `2022`, etc.) in the assistant (experimental)
- Removed the deprecated _Angular CLI_ decorator (`decorate-angular-cli.js`)
- Refreshed the cryptocurrencies list

29
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 &&

Loading…
Cancel
Save