|
|
|
@ -1,4 +1,10 @@ |
|
|
|
import { ListService } from '@abp/ng.core'; |
|
|
|
import { |
|
|
|
ListService, |
|
|
|
ConfigStateService, |
|
|
|
getShortDateFormat, |
|
|
|
getShortDateShortTimeFormat, |
|
|
|
getShortTimeFormat, |
|
|
|
} from '@abp/ng.core'; |
|
|
|
import { formatDate } from '@angular/common'; |
|
|
|
import { |
|
|
|
ChangeDetectionStrategy, |
|
|
|
@ -59,7 +65,11 @@ export class ExtensibleTableComponent<R = any> implements OnChanges { |
|
|
|
|
|
|
|
readonly trackByFn: TrackByFunction<EntityProp<R>> = (_, item) => item.name; |
|
|
|
|
|
|
|
constructor(@Inject(LOCALE_ID) private locale: string, injector: Injector) { |
|
|
|
constructor( |
|
|
|
@Inject(LOCALE_ID) private locale: string, |
|
|
|
private config: ConfigStateService, |
|
|
|
injector: Injector, |
|
|
|
) { |
|
|
|
// tslint:disable-next-line
|
|
|
|
this.getInjected = injector.get.bind(injector); |
|
|
|
const extensions = injector.get(ExtensionsService); |
|
|
|
@ -95,11 +105,11 @@ export class ExtensibleTableComponent<R = any> implements OnChanges { |
|
|
|
case ePropType.Boolean: |
|
|
|
return this.getIcon(value); |
|
|
|
case ePropType.Date: |
|
|
|
return this.getDate(value, 'yyyy-MM-dd'); |
|
|
|
return this.getDate(value, getShortDateFormat(this.config)); |
|
|
|
case ePropType.Time: |
|
|
|
return this.getDate(value, 'HH:mm'); |
|
|
|
return this.getDate(value, getShortTimeFormat(this.config)); |
|
|
|
case ePropType.DateTime: |
|
|
|
return this.getDate(value, 'yyyy-MM-dd HH:mm:ss Z'); |
|
|
|
return this.getDate(value, getShortDateShortTimeFormat(this.config)); |
|
|
|
default: |
|
|
|
return value; |
|
|
|
// More types can be handled in the future
|
|
|
|
|