Skip to content

Instantly share code, notes, and snippets.

@ziishaned
Created May 21, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziishaned/45e949774b7be871c60319bb28057d4e to your computer and use it in GitHub Desktop.
Save ziishaned/45e949774b7be871c60319bb28057d4e to your computer and use it in GitHub Desktop.
Check if provided date is equal or between two dates
const isDateBetweenOrEqual = (checkDate, fromDate, toDate) => {
const toMS = Date.parse(toDate);
const checkMS = Date.parse(check);
const fromMS = Date.parse(fromDate);
return checkMS >= fromMS && checkMS <= toMS;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment