src/utils.js
function isSelected(selectedDates, date) {
  selectedDates = Array.isArray(selectedDates)
    ? selectedDates
    : [selectedDates];
  return selectedDates.some(selectedDate => {
    if (
      selectedDate instanceof Date &&
      startOfDay(selectedDate).getTime() === startOfDay(date).getTime()
    ) {
      return true;
    }
    return false;
  });
}
function isSelected(selectedDates, date) {
  selectedDates = Array.isArray(selectedDates)
    ? selectedDates
    : [selectedDates];
  return selectedDates.some(selectedDate => {
    if (
      selectedDate instanceof Date &&
      startOfDay(selectedDate).getTime() === startOfDay(date).getTime()
    ) {
      return true;
    }
    return false;
  });
}
function isSelected ( selectedDates , date ) { selectedDates = Array . isArray ( selectedDates ) ? selectedDates : [ selectedDates ] ; return selectedDates . some ( selectedDate => { if ( selectedDate instanceof Date && startOfDay ( selectedDate ) . getTime ( ) === startOfDay ( date ) . getTime ( ) ) { return true ; } return false ; } ) ; }
Normalizes dates to the beginning of the day,
then checks to see if the day given is found
in the selectedDates.
@param {Array.<Date>} selectedDates An array of dates currently selected
@param {Date} date The date to search with against selectedDates
@returns {Boolean} Whether day is found in selectedDates
Normalizes dates to the beginning of the day then checks to see if the day given is found in the selectedDates .