import { format } from 'date-fns'
export function useTimeFormatter(pattern = 'yyyy-MM-dd HH:mm') {
    return function (row, column, value, index) {
        try {
            return format(new Date(value), pattern)
        } catch (error) {
            return ''
        }
    }
}

export function useEnumFormatter(enumObj) {
    return function (row, column, value, index) {
        return enumObj[value]
    }
}
