[update]
This commit is contained in:
19
src/app/@common/utils/thaidate.pipe.ts
Normal file
19
src/app/@common/utils/thaidate.pipe.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'thaidate',
|
||||
pure :true
|
||||
})
|
||||
export class ThaidatePipe implements PipeTransform {
|
||||
|
||||
transform(value: string): string {
|
||||
if(!value) return '-'
|
||||
let date = new Date(value).toLocaleDateString('th-TH', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
})
|
||||
return date
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user