import Vue from 'vue'

export const formatDate = (value) => {
  if (!value) return ''
  return Vue.prototype.$dayjs(new Date(value)).format('DD/MM/YYYY')
}
export const formatTime = (value) => {
  if (!value) return ''
  return Vue.prototype.$dayjs(new Date(value)).format('HH:mm')
}
export const formatDateTime = (value) => {
  if (!value) return ''
  return Vue.prototype.$dayjs(new Date(value)).format('DD/MM/YYYY HH:mm')
}

export default {
  formatDateTime,
  formatDate,
  formatTime
}
