export const getDateValue = (value: string) => {
  const time = new Date(value).getTime();
  return Number.isNaN(time) ? 0 : time;
};

export const formatDate = (value: string) => {
  const time = getDateValue(value);

  return time === 0
    ? ''
    : new Intl.DateTimeFormat('ru-RU', {
        day: '2-digit',
        month: 'long',
        year: 'numeric',
      }).format(time);
};
