League\Period\Period::previous PHP Метод

previous() публичный Метод

If no duration is provided the new Period will have the same duration as the current one The interval can be
  • a DateInterval object
  • an int interpreted as the duration expressed in seconds.
  • a string in a format supported by DateInterval::createFromDateString
public previous ( DateInterva\DateInterval | integer | string $interval = null ) : static
$interval DateInterva\DateInterval | integer | string The interval
Результат static
    public function previous($interval = null)
    {
        if (is_null($interval)) {
            $interval = $this->getDateInterval();
        }
        return new static($this->startDate->sub(static::filterDateInterval($interval)), $this->startDate);
    }