Created
January 12, 2022 21:31
-
-
Save mark05e/b5ed458bd5c5f254fb66b70ed648b441 to your computer and use it in GitHub Desktop.
Check if the date provided is today
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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