import { isPast } from 'date-fns'

export const getLandingName = () => {
  const splitPath = window.location.pathname.split('/')
  return splitPath[2]
}

const convertToDate = (date: string) => {
  const d = date.split('.')
  return new Date(`${d[2]}/${d[1]}/${d[0]}`)
}

export const isPastLandingDate = (data: string) => {
  const landingDate = convertToDate(data)
  return isPast(landingDate)
}
