XBRL-Instance.php
public function ContextWithDuration( $months )
	{
		$durationContexts = $this->DurationContexts();
		$oneDay = new DateInterval("P1D");
		return new ContextsFilter( $instance, array_filter( $durationContexts->getContexts(), function( $context ) use( $months, $oneDay )
		{
			$interval = date_diff(
				new DateTime( $context["period"]["startDate"] ),
				(new DateTime( $context["period"]["endDate"] ))->add( $oneDay ) );

			return $months == ( $interval->m + ( $interval->y * 12 ) );
		} ) );
	}
public function ContextWithDuration( $months )
	{
		$durationContexts = $this->DurationContexts();
		$oneDay = new DateInterval("P1D");
		return new ContextsFilter( $instance, array_filter( $durationContexts->getContexts(), function( $context ) use( $months, $oneDay )
		{
			$interval = date_diff(
				new DateTime( $context["period"]["startDate"] ),
				(new DateTime( $context["period"]["endDate"] ))->add( $oneDay ) );

			return $months == ( $interval->m + ( $interval->y * 12 ) );
		} ) );
	}
public function ContextWithDuration ( $ months ) { $ durationContexts = $ this -> DurationContexts ( ) ; $ oneDay = new DateInterval ( "P1D" ) ; return new ContextsFilter ( $ instance , array_filter ( $ durationContexts -> getContexts ( ) , function ( $ context ) use ( $ months , $ oneDay ) { $ interval = date_diff ( new DateTime ( $ context [ "period" ] [ "startDate" ] ) , ( new DateTime ( $ context [ "period" ] [ "endDate" ] ) ) -> add ( $ oneDay ) ) ; return $ months == ( $ interval -> m + ( $ interval -> y * 12 ) ) ; } ) ) ; }
Return context with a specified number of months duration
@param int $months
Return context with a specified number of months duration