Determines whether a valid iCalendar date is within a given range

@param  string  $calendarDate
@param  integer $minTimestamp
@param  integer $maxTimestamp
@return boolean
175505
protected function isOutOfRange($calendarDate, $minTimestamp, $maxTimestamp)
    {
        $timestamp = strtotime(explode('T', $calendarDate)[0]);

        return $timestamp < $minTimestamp || $timestamp > $maxTimestamp;
    }
381187
function isMonthWithinRange(date, minDate, maxDate) {
       var month = date.getMonth();
       var year = date.getFullYear();

       return (!minDate || minDate.getFullYear() < year || minDate.getMonth() <= month) &&
        (!maxDate || maxDate.getFullYear() > year || maxDate.getMonth() >= month);
     }
609621
public static function isTimestamp($tstamp)
    {
        return ((string)(int)$tstamp === $tstamp)
        && ($tstamp <= PHP_INT_MAX)
        && ($tstamp >= ~PHP_INT_MAX);
    }
188832
@Override
    public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
307419
@Override
  public boolean isTimeIncluded (final long timeStamp)
  {
    if (m_bExcludeAll == true)
    {
      return false;
    }

    // Test the base calendar first. Only if the base calendar not already
    // excludes the time/date, continue evaluating this calendar instance.
    if (super.isTimeIncluded (timeStamp) == false)
    {
      return false;
    }

    final Calendar cl = createJavaCalendar (timeStamp);
    final int wday = cl.get (Calendar.DAY_OF_WEEK);

    return !(isDayExcluded (wday));
  }
257801
public function max(Date $dt = null)
    {
        $dt = $dt ?: static::now($this->getTimezone());

        return $this->isAfter($dt) ? clone $this : clone $dt;
    }
339790
public function isInTime(DateTimeInterface $now) : bool
	{
		if ($times = $this->values[static::TIME]) {
			foreach ($times as $time) {
				if ($time['to'] && $time['to'] >= $now->format('H:i') && $time['from'] <= $now->format('H:i')) {
					// Is in range with precision to minutes
					return TRUE;
				} elseif ($time['from'] == $now->format('H:i')) {
					// Is in specific minute
					return TRUE;
				}
			}

			return FALSE;
		}

		return TRUE;
	}
1113513
protected function validateTimestamps(array $payload)
    {
        if (isset($payload['nbf']) && Utils::timestamp($payload['nbf'])->isFuture()) {
            throw new TokenInvalidException('Not Before (nbf) timestamp cannot be in the future', 400);
        }

        if (isset($payload['iat']) && Utils::timestamp($payload['iat'])->isFuture()) {
            throw new TokenInvalidException('Issued At (iat) timestamp cannot be in the future', 400);
        }

        if (Utils::timestamp($payload['exp'])->isPast()) {
            throw new TokenExpiredException('Token has expired');
        }

        return true;
    }
401109
private function hasLifetimeExpired($currentTimestamp, $periodTimestamp)
    {
        $timestamp = $this->getTimestamp();
        return (bool) ($currentTimestamp - $timestamp >= $periodTimestamp);
    }
797915
public static function isTimestamp($timestamp)
    {
        if (!$timestamp || !is_numeric($timestamp) || 10 !== \strlen($timestamp)) {
            return false;
        }

        return date('Ymd', $timestamp) ? true : false;
    }
776857
private boolean isDate(Class clazz)
    {
        return clazz.isAssignableFrom(Date.class) || clazz.isAssignableFrom(java.sql.Date.class)
                || clazz.isAssignableFrom(Timestamp.class) || clazz.isAssignableFrom(Time.class)
                || clazz.isAssignableFrom(Calendar.class);
    }
826521
protected static ICalParameters handleTzidParameter(ICalProperty property, boolean hasTime, WriteContext context) {
		ICalParameters parameters = property.getParameters();

		//date values don't have timezones
		if (!hasTime) {
			return parameters;
		}

		//vCal doesn't use the TZID parameter
		if (context.getVersion() == ICalVersion.V1_0) {
			return parameters;
		}

		//floating values don't have timezones
		TimezoneInfo tzinfo = context.getTimezoneInfo();
		boolean floating = tzinfo.isFloating(property);
		if (floating) {
			return parameters;
		}

		TimezoneAssignment tz;
		TimezoneAssignment globalTz = context.getGlobalTimezone();
		if (globalTz == null) {
			tz = tzinfo.getTimezoneToWriteIn(property);
			if (tz == null) {
				//write in UTC
				return parameters;
			}
		} else {
			tz = globalTz;
		}

		String tzid = null;
		VTimezone component = tz.getComponent();
		String globalId = tz.getGlobalId();
		if (component != null) {
			tzid = ValuedProperty.getValue(component.getTimezoneId());
		} else if (globalId != null) {
			tzid = '/' + globalId;
		}

		if (tzid == null) {
			//should never happen
			tzid = tz.getTimeZone().getID();
		}

		parameters = new ICalParameters(parameters);
		parameters.setTimezoneId(tzid);
		return parameters;
	}
674586
@Override
  public boolean isTimeIncluded (final long timeInMillis)
  {
    if (getBaseCalendar () != null && !getBaseCalendar ().isTimeIncluded (timeInMillis))
    {
      return false;
    }

    return !m_aCronExpression.isSatisfiedBy (new Date (timeInMillis));
  }
971940
public function maxDate($max, $msg)
    {
        if(is_numeric($max)) { // Probably an epoch.
            $max = new \DateTime('@' . $max);
        }
        else {
            $max = new \DateTime($max);
        }
        
        try {
            $dt = new \DateTime($this->_value, new \DateTimeZone("UTC"));
        }
        catch(Exception $e) {
            $this->_errors[] = $msg;
        }
        
        if($dt > $max) {
            $this->_errors[] = $msg;
        }
        
        return $this;
    }
787753
public static function isValidTimeStamp($timestamp)
    {
        return ((string) (integer) $timestamp === (string) $timestamp) && $timestamp <= PHP_INT_MAX && $timestamp >= ~PHP_INT_MAX;
    }
217769
public boolean insideRange(Calendar startDate,
			       Calendar endDate) {
	// make a copy of the start time so that it is safe to modify it without
	// affecting the input parameter
	Calendar mutableStartDate = (Calendar)(startDate.clone());
	return isInRange(mutableStartDate, endDate);
    }
45204
public function valid_datetime($sDateTime, $sFormat)
    {
        //  If blank, then assume the date is not required
        if (empty($sDateTime)) {
            return true;
        }

        if (empty($sFormat)) {
            $sFormat = 'Y-m-d H:i:s';
        }

        if (!array_key_exists('valid_datetime', $this->_error_messages)) {
            $this->set_message('valid_datetime', lang('fv_valid_datetime_field'));
        }

        try {

            $oDate = \DateTime::createFromFormat($sFormat, $sDateTime);

            if (empty($oDate)) {
                return false;
            }

            return $oDate->format($sFormat) == $sDateTime;

        } catch (\Exception $e) {

            return false;
        }
    }