-เชื่อมโยง api search กับ frontend
-ปรับปรุงระบบ state -เพิ่ม ระบบ pipe dtmtodatetime
This commit is contained in:
24
accounting-ng-nuttakit/src/app/pipe/dtmtodatetime.pipe.ts
Normal file
24
accounting-ng-nuttakit/src/app/pipe/dtmtodatetime.pipe.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
|
||||
const dd = str.slice(0, 2);
|
||||
const mm = str.slice(2, 4);
|
||||
const yyyy = str.slice(4, 8);
|
||||
const hh = str.slice(8, 10);
|
||||
const min = str.slice(10, 12);
|
||||
|
||||
return `${dd}/${mm}/${yyyy} ${hh}:${min}`;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user