Files
micro-frontend/accounting-ng-nuttakit/src/app/pipe/dtmtodatetime.pipe.ts

25 lines
569 B
TypeScript
Raw Normal View History

import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'dtmtodatetime',
standalone: false
})
export class AccDateFormatPipe implements PipeTransform {
transform(value: string | number): string {
if (value === null || value === undefined) return '';
const str = value.toString();
if (str.length !== 12) return str;
2025-11-21 19:35:46 +07:00
const yyyy = str.slice(0, 4);
const mm = str.slice(4, 6);
const dd = str.slice(6, 8);
const hh = str.slice(8, 10);
const min = str.slice(10, 12);
return `${dd}/${mm}/${yyyy} ${hh}:${min}`;
}
}