| | |
| | | constructor(private dateService: DateService) { |
| | | } |
| | | |
| | | transform(value: any, col?: Column): any { |
| | | transform(value: any, col?: Column, row?: any ): any { |
| | | const t = Types.Date; |
| | | const type = col.type; |
| | | if (type != null && type.name != null) { |
| | | if ( value != null && value !== '' && type != null && type.name != null) { |
| | | value = this.transformHandle(value, type.name, type.format); |
| | | } |
| | | if (col.format !== null && col.format instanceof Function ) { |
| | | value = col.format(value, col, row); |
| | | } |
| | | return value; |
| | | } |
| | | private transformHandle(value: any, type: Types, format: any): any{ |
| | | private transformHandle(value: any, type: Types, format: any): any { |
| | | switch (type) { |
| | | case Types.Date: |
| | | return this.dateService.date_format(value, format); |
| | | } |
| | | } |
| | | } |
| | | } |