import format from 'date-fns/format'

type prepareTimeFormat = {
  date: Date,
  isNeedFormatTimeChanged: boolean,
}

export const getPrepareDateFormat = ({
  date,
  isNeedFormatTimeChanged,
}: prepareTimeFormat) => (
  isNeedFormatTimeChanged
    ? format(date, 'MM.dd.yy')
    : format(date, 'dd.MM.yy')
)
