|
|
|
@ -4,30 +4,31 @@ import { ConfigStateService } from '../services'; |
|
|
|
import { getShortDateShortTimeFormat } from '../utils/date-utils'; |
|
|
|
|
|
|
|
@Pipe({ |
|
|
|
standalone: false, |
|
|
|
name: 'shortDateTime', |
|
|
|
pure: true, |
|
|
|
}) |
|
|
|
export class ShortDateTimePipe extends DatePipe implements PipeTransform { |
|
|
|
|
|
|
|
constructor(private configStateService: ConfigStateService, |
|
|
|
constructor( |
|
|
|
private configStateService: ConfigStateService, |
|
|
|
@Inject(LOCALE_ID) locale: string, |
|
|
|
@Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string|null |
|
|
|
) { |
|
|
|
super(locale, defaultTimezone) |
|
|
|
@Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string | null, |
|
|
|
) { |
|
|
|
super(locale, defaultTimezone); |
|
|
|
} |
|
|
|
|
|
|
|
transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null; |
|
|
|
transform( |
|
|
|
value: Date | string | number, |
|
|
|
format?: string, |
|
|
|
timezone?: string, |
|
|
|
locale?: string, |
|
|
|
): string | null; |
|
|
|
transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null; |
|
|
|
transform( |
|
|
|
value: string|number|Date|null|undefined, timezone?: string, |
|
|
|
locale?: string): string|null { |
|
|
|
|
|
|
|
const format = getShortDateShortTimeFormat(this.configStateService); |
|
|
|
return super.transform(value,format,timezone,locale) |
|
|
|
value: string | number | Date | null | undefined, |
|
|
|
timezone?: string, |
|
|
|
locale?: string, |
|
|
|
): string | null { |
|
|
|
const format = getShortDateShortTimeFormat(this.configStateService); |
|
|
|
return super.transform(value, format, timezone, locale); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|