import dayjs from 'dayjs'

export function formatDate (date, format) {
  let newDate = null

  if (date && dayjs(date).isValid()) {
    newDate = dayjs(date).format(format)
  }

  return newDate
}

export function formatDateObject (date, format) {
  let newDate = null

  if (date && dayjs(date).isValid()) {
    newDate = dayjs(date, format)
  }

  return newDate
}
