From 8bf5136213c9b70a88d93dbce176c3260ca7443a Mon Sep 17 00:00:00 2001 From: mister-ideas <36502095+mister-ideas@users.noreply.github.com> Date: Mon, 19 Oct 2026 02:21:03 +0200 Subject: [PATCH 1/2] Feature/change default date range of users to year to date --- CHANGELOG.md | 1 + apps/api/src/app/user/user.service.ts | 4 ++-- libs/common/src/lib/config.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e35621f0b..a61f150497 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 +- Changed the default date range of users without a stored date range from `max` to `ytd` - Improved the usability of the activities page by eliminating the reload on canceling the import activities dialog - Improved the accessibility of the _Buy me a coffee_ button on the about page - Improved the accessibility of the entity logo component diff --git a/apps/api/src/app/user/user.service.ts b/apps/api/src/app/user/user.service.ts index c2f5ad5661..f997c8366a 100644 --- a/apps/api/src/app/user/user.service.ts +++ b/apps/api/src/app/user/user.service.ts @@ -12,7 +12,7 @@ import { PropertyService } from '@ghostfolio/api/services/property/property.serv import { TagService } from '@ghostfolio/api/services/tag/tag.service'; import { DEFAULT_CURRENCY, - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, DEFAULT_LOCALE, DELETE_OWN_USER_PERIOD, PROPERTY_API_KEY_GHOSTFOLIO, @@ -362,7 +362,7 @@ export class UserService { (user.settings.settings as UserSettings).viewMode === 'ZEN' ? 'max' : ((user.settings.settings as UserSettings)?.dateRange ?? - DEFAULT_DATE_RANGE); + DEFAULT_USER_DATE_RANGE); // Set default value for performance calculation type if (!(user.settings.settings as UserSettings)?.performanceCalculationType) { diff --git a/libs/common/src/lib/config.ts b/libs/common/src/lib/config.ts index 61008f1fc7..aa914f16d6 100644 --- a/libs/common/src/lib/config.ts +++ b/libs/common/src/lib/config.ts @@ -100,6 +100,7 @@ export const STATISTICS_GATHERING_QUEUE = 'STATISTICS_GATHERING_QUEUE'; export const DEFAULT_CURRENCY = 'USD'; export const DEFAULT_DATE_FORMAT_MONTH_YEAR = 'MMM yyyy'; export const DEFAULT_DATE_RANGE: DateRange = 'max'; +export const DEFAULT_USER_DATE_RANGE: DateRange = 'ytd'; export const DEFAULT_HOST = '0.0.0.0'; export const DEFAULT_LANGUAGE_CODE = 'en'; export const DEFAULT_LOCALE = 'en-US'; From 799da6831dfb8fda97393cc7b20fb3637c8237d3 Mon Sep 17 00:00:00 2001 From: mister-ideas <36502095+mister-ideas@users.noreply.github.com> Date: Mon, 19 Oct 2026 13:26:36 +0200 Subject: [PATCH 2/2] Feature/use year-to-date as the fallback date range in the client --- .../home-holdings/home-holdings.component.ts | 4 ++-- .../home-overview/home-overview.component.ts | 4 ++-- .../portfolio/analysis/analysis-page.component.ts | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/client/src/app/components/home-holdings/home-holdings.component.ts b/apps/client/src/app/components/home-holdings/home-holdings.component.ts index 333a24d5d6..c20191f750 100644 --- a/apps/client/src/app/components/home-holdings/home-holdings.component.ts +++ b/apps/client/src/app/components/home-holdings/home-holdings.component.ts @@ -1,7 +1,7 @@ import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_CURRENCY, - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, DEFAULT_LOCALE } from '@ghostfolio/common/config'; import { @@ -66,7 +66,7 @@ export class GfHomeHoldingsComponent implements OnInit { }); protected readonly dateRange = computed(() => { - return this.user()?.settings?.dateRange ?? DEFAULT_DATE_RANGE; + return this.user()?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE; }); protected readonly deviceType = computed(() => { diff --git a/apps/client/src/app/components/home-overview/home-overview.component.ts b/apps/client/src/app/components/home-overview/home-overview.component.ts index c7b880efce..a9a14348a8 100644 --- a/apps/client/src/app/components/home-overview/home-overview.component.ts +++ b/apps/client/src/app/components/home-overview/home-overview.component.ts @@ -4,7 +4,7 @@ import { ImpersonationStorageService } from '@ghostfolio/client/services/imperso import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_CURRENCY, - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, DEFAULT_LOCALE, NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; @@ -191,7 +191,7 @@ export class GfHomeOverviewComponent implements OnInit { this.dataService .fetchPortfolioPerformance({ - range: userSettings?.dateRange ?? DEFAULT_DATE_RANGE + range: userSettings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ chart, errors, performance }) => { diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts index 8ba3f0fd8a..cd1b20cf5d 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -1,7 +1,7 @@ import { GfBenchmarkComparatorComponent } from '@ghostfolio/client/components/benchmark-comparator/benchmark-comparator.component'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { - DEFAULT_DATE_RANGE, + DEFAULT_USER_DATE_RANGE, NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; import { SubscriptionType } from '@ghostfolio/common/enums'; @@ -249,12 +249,12 @@ export class GfAnalysisPageComponent implements OnInit { dividends: this.dataService.fetchDividends({ filters: this.userService.getFilters(), groupBy: this.mode(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }), investments: this.dataService.fetchInvestments({ filters: this.userService.getFilters(), groupBy: this.mode(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) }) .pipe(takeUntilDestroyed(this.destroyRef)) @@ -323,7 +323,7 @@ export class GfAnalysisPageComponent implements OnInit { .fetchPortfolioPerformance({ filters: this.userService.getFilters(), groupBy: 'year', - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ chart }) => { @@ -353,7 +353,7 @@ export class GfAnalysisPageComponent implements OnInit { this.dataService .fetchPortfolioPerformance({ filters: this.userService.getFilters(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE }) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe(({ chart, dateOfFirstActivity, performance }) => { @@ -482,7 +482,7 @@ export class GfAnalysisPageComponent implements OnInit { dataSource, symbol, filters: this.userService.getFilters(), - range: this.user?.settings?.dateRange ?? DEFAULT_DATE_RANGE, + range: this.user?.settings?.dateRange ?? DEFAULT_USER_DATE_RANGE, startDate: this.dateOfFirstActivity }) .pipe(takeUntilDestroyed(this.destroyRef))