Checks if date supplied is in range of event

@param \DateTime $date
@return bool
183781
public function dateIsInRange(\DateTime $date) {
    $dateInRange = FALSE;

    $t1 = $this->start_date->getTimeStamp();
    $t2 = $this->end_date->getTimeStamp();

    $t3 = $date->getTimeStamp();

    if (($t3 >= $t1) && ($t3 <= $t2)) {
      $dateInRange = TRUE;
    }

    return $dateInRange;
  }
924533
private function dateIsInRequestFrame(\DateTime $date)
    {
        if (null === $date) {
            return false;
        }

        return (new \DateTime())->add(self::getResetInterval()) < $date->add(self::getRequestInterval());
    }
273103
public static function date2sql($date)
    {
        $dt = new Datetime();
        
        return ($dt->set_date($date)) ? $dt->toSql() : false;
    }
198840
public function isValidDate($datetime, string $format = 'Y-m-d H:i:s'): bool
    {
        $dateType = DateTime::createFromFormat($format, $datetime);
        return (bool) ($dateType && $dateType->format($format) === $datetime);
    }
1133940
static public function validate($date)
    {
      // Check if date is a string
      if(is_string($date) && strlen(trim($date)) > 0)
        return false;
        
      // Check if date matches pattern
      if(!preg_match('/^' . self::PATTERN . '$/', $date, $matches))
        return false;
          
      // Extract values from date
      list($original, $year, $month, $day) = $matches;
          
      // Check if all values are valid
      if(!self::validateDate($year, $month, $day))
        return false;
            
      return true;
    }
523039
public function containsExclusive(Date $date) : bool
    {
        return $this->start->comesBefore($date) && $this->end->comesAfter($date);
    }
917229
public function isContains(DateTime $Date, $inclusive = true) {
		if ($inclusive) {
			return $this->_startDate <= $Date && $Date <= $this->_endDate;
		} else {
			return $this->_startDate < $Date && $Date < $this->_endDate;
		}
	}
1285975
public function findEventsByDate($date)
    {
        return $this->model->where('is_published', 1)
            ->where('published_at', '<=', Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s'))
            ->orderBy('created_at', 'desc')->where('start_date', '<=', $date)
            ->where('end_date', '>=', $date)->get();
    }
908268
public static function isBetweenDates(?DateTimeInterface $date = null, ?DateTimeInterface $from = null, ?DateTimeInterface $to = null): bool
    {
        $date = $date ?? self::createFromTimestamp();

        if ($from instanceof DateTimeInterface && $date < $from) {
            return false;
        }

        if ($to instanceof DateTimeInterface && $date > $to) {
            return false;
        }

        return true;
    }
354160
public function isDue(\DateTime $date = null)
    {
        // The execution time is being defaulted if not defined
        if (!$this->executionTime) {
            $this->at('* * * * *');
        }

        $date = $date ?? $this->creationTime;

        return $this->executionTime->isDue($date);
    }
251906
public static function validDateForm($date)
    {
        $isOK = true;
        if (preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $date)) {
            list($d, $m, $y) = explode("/", $date);
            $month = (int)$m;
            $day   = (int)$d;
            $year  = (int)$y;
            if (!checkdate($month, $day, $year)) {
                $isOK = false;
            }
        } else {
            $isOK = false;
        }
        if ($isOK == false) {
            $date = date('d/m/Y');
        }

        return $date;
    }
608521
private static function dateIsTargetDay(\DateTime $date)
    {
        // $date is a saturday or sunday?
        if($date->format('N') === '6' || $date->format('N') === '7')
            return false;

        $day = $date->format('m-d');
        if($day === '01-01'             // new year's day
            || $day === '05-01'         // labour day
            || $day === '12-25'         // first christmas day
            || $day === '12-26')        // second christmas day
            return false;

        $year = $date->format('Y');
        $easter = easterDate((int) $year);      // contains easter sunday
        $goodFriday =   $easter->modify('-2 days')->format('m-d');      // $easter contains now good friday
        $easterMonday = $easter->modify('+3 days')->format('m-d');      // $easter contains now easter monday

        if($day === $goodFriday || $day === $easterMonday)
            return false;

        return true;
    }
14121
public static function isDateFormat($date, $format = 'Y-m-d')
    {
        if (!$unixTime = strtotime($date)) {
            return false;
        }

        // 校验日期的格式有效性
        if (date($format, $unixTime) === $date) {
            return true;
        }

        return false;
    }
162904
public static function isValid($date)
	{
		if(self::validateXSDDateTimeFormat($date) && self::validateXSDDateTimeValue($date))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
496442
private function isDatetime($dateTime)
    {
        if (preg_match('/^(\d{4})-(\d\d?)-(\d\d?) (\d\d?):(\d\d?):(\d\d?)$/', $dateTime, $matches)) {
            return checkdate($matches[2], $matches[3], $matches[1]) && $matches[4] / 24 < 1 && $matches[5] / 60 < 1 && $matches[6] / 60 < 1;
        }
        return false;
    }
1111068
public static function hasFormat($date, $format)
    {
        try {
            // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string
            // doesn't match the format in any way.
            static::createFromFormat($format, $date);

            // createFromFormat() is known to handle edge cases silently.
            // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format.
            // To ensure we're really testing against our desired format, perform an additional regex validation.
            $regex = strtr(
                preg_quote($format, '/'),
                static::$regexFormats
            );

            return (bool) preg_match('/^'.$regex.'$/', $date);
        } catch (InvalidArgumentException $e) {
        }

        return false;
    }
738170
public static function isValidDate($date)
    {
        $d = $this->splitDate($date, 'int');
        if ($d['year'] > 0 && $d['month'] > 0 && $d['date'] > 0) {
            return checkdate($d['month'], $d['date'], $d['year']);
        } else {
            return false;
        }
    }