code: private static function matchesDateCriteria($key, RateInterface $rate, array $criteria)
      {
          $date = self::extractDateCriteria($key, $criteria);
  
          if ($date === null) {
              return true;
          }
  
          if ($key === 'dateFrom') {
              $rateDate = new \DateTime($rate->getDate()->format(\DateTime::ATOM));
              $rateDate->setTime(23, 59, 59);
              return $date <= $rateDate;
          }
  
          if ($key === 'dateTo') {
              $rateDate = new \DateTime($rate->getDate()->format(\DateTime::ATOM));
              $rateDate->setTime(0, 0, 0);
              return $date >= $rateDate;
          }
  
          return $date->format('Y-m-d') === $rate->getDate()->format('Y-m-d');
      }
docs: Check if date criteria is matched.
  
  @param string $key Date criteria key.
  @param RateInterface $rate Rate to check for match.
  @param array $criteria Filter criterias.
  @return bool TRUE if there is a match.