Skip to content

Instantly share code, notes, and snippets.

@mark05e
Created January 12, 2022 21:31
Show Gist options
  • Save mark05e/b5ed458bd5c5f254fb66b70ed648b441 to your computer and use it in GitHub Desktop.
Save mark05e/b5ed458bd5c5f254fb66b70ed648b441 to your computer and use it in GitHub Desktop.
Check if the date provided is today
// https://flaviocopes.com/how-to-determine-date-is-today-javascript/
const isToday = (someDate) => {
const today = new Date()
someDate = new Date(someDate);
return someDate.getDate() == today.getDate() &&
someDate.getMonth() == today.getMonth() &&
someDate.getFullYear() == today.getFullYear()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment