To judge whether it is today

export const isToday = date => {
    
    
  const today = new Date()

  return (
    /* eslint-disable operator-linebreak */
    date.getDate() === today.getDate() &&
    date.getMonth() === today.getMonth() &&
    date.getFullYear() === today.getFullYear()
    /* eslint-enable */
  )
}

Guess you like

Origin blog.csdn.net/weixin_41886421/article/details/129328979