src/Cronner/Tasks/Parameters.php
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;
	}
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;
	}
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 ; }
Returns true if current time is in allowed range.
Returns true if current time is in allowed range .