import { Pipe, PipeTransform } from "@angular/core"

// const config = {
//     year: 'numberic',
//     month: 'long',
//     day: 'numeric',
// }

@Pipe({
    name: 'thaidate',
    pure: true
})

export class ThaidatePipe implements PipeTransform {

    transform(value: Date): unknown {
        if(!value) return '-'
        let date = new Date(value).toLocaleDateString('th-TH',{
            year: 'numeric',
            month: 'short',
            day: 'numeric',
        })
        return date
    }


}

