From a36a43fd3372a862b17505a810e093a18dee6e52 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 6 Aug 2026 14:37:11 +0200 Subject: [PATCH] Add live preview of date and number format --- .../user-account-settings.component.ts | 9 +++++++ .../user-account-settings.html | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts index b48adf59d..18ce8e07c 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts @@ -22,6 +22,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, + computed, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, inject, @@ -50,6 +51,7 @@ import { format, parseISO } from 'date-fns'; import { addIcons } from 'ionicons'; import { eyeOffOutline, eyeOutline } from 'ionicons/icons'; import ms from 'ms'; +import { DeviceDetectorService } from 'ngx-device-detector'; import { EMPTY, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; @@ -108,10 +110,17 @@ export class GfUserAccountSettingsComponent implements OnInit { 'uk', 'zh' ]; + protected readonly previewDate = new Date().toISOString(); + protected readonly previewValue = 9999.99; protected user: User; + protected readonly deviceType = computed( + () => this.deviceDetectorService.deviceInfo().deviceType + ); + private readonly changeDetectorRef = inject(ChangeDetectorRef); private readonly dataService = inject(DataService); + private readonly deviceDetectorService = inject(DeviceDetectorService); private readonly destroyRef = inject(DestroyRef); private readonly notificationService = inject(NotificationService); private readonly settingsStorageService = inject(SettingsStorageService); diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.html b/apps/client/src/app/components/user-account-settings/user-account-settings.html index 57d3b54d7..4c956b2e5 100644 --- a/apps/client/src/app/components/user-account-settings/user-account-settings.html +++ b/apps/client/src/app/components/user-account-settings/user-account-settings.html @@ -171,6 +171,32 @@ +
+
+ Preview +
+
+ Date + Value +
+
Appearance