From 1b4f4fe0ea70fc5c16ee4e92129e82c31d99dca6 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Wed, 9 Apr 2025 11:17:06 +0300 Subject: [PATCH] refactoring --- .../extensible-table/extensible-table.component.ts | 6 ++++++ .../packages/core/src/lib/pipes/utc-to-local.pipe.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts index 86de7f0ff2..94b73dba1d 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts @@ -31,6 +31,7 @@ import { LocalizationModule, PermissionDirective, PermissionService, + UtcToLocalPipe, } from '@abp/ng.core'; import { AbpVisibleDirective, @@ -64,6 +65,7 @@ const DEFAULT_ACTIONS_COLUMN_WIDTH = 150; NgxDatatableListDirective, PermissionDirective, LocalizationModule, + UtcToLocalPipe, AsyncPipe, NgTemplateOutlet, NgComponentOutlet, @@ -235,4 +237,8 @@ export class ExtensibleTableComponent implements OnChanges, AfterViewIn this.cdr.markForCheck(); }); } + + isDateType(prop: EntityProp) { + return prop.type === ePropType.Date || prop.type === ePropType.DateTime; + } } diff --git a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts index 5667e1a4fc..3c878cef22 100644 --- a/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts +++ b/npm/ng-packs/packages/core/src/lib/pipes/utc-to-local.pipe.ts @@ -11,8 +11,10 @@ export class UtcToLocalPipe implements PipeTransform { transform( value: string | Date | null | undefined, + apply: boolean, options?: Intl.DateTimeFormatOptions, ): string | Date { + if (!apply) return value; if (!value) return ''; try { @@ -30,7 +32,7 @@ export class UtcToLocalPipe implements PipeTransform { hour: '2-digit', minute: '2-digit', }; - + console.log(this.timezoneService.getTimezone()); const formatter = new Intl.DateTimeFormat('en-US', { ...formatOptions, timeZone: this.timezoneService.getTimezone(),