Sawtaytoes
10/15/2018 - 12:12 AM

`isHalloween()` Function

This function, as simple as it is, would also be prone to breaking over time with code changes. The biggest drawback is it's not able to be unit tested which hinders our refactor.

const currentYear = (
  moment()
  .format('YYYY')
)

const isHalloween = () => (
  moment()
  .isBetween(
    `${currentYear}-10-31 16:00`,
    `${currentYear}-10-31 23:30`
  )
)