ziishaned
5/21/2019 - 11:47 AM

Check if provided date is equal or between two dates

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;
},