public function isPublished( $now = null )
    {
        if ( ! $this->published )
        {
            return false;
        }

        if ( empty( $now ) )
        {
            $now = new DateTime();
        }
        else
        {
            $now = $this->inputDate( $now );
        }

        if ( ! empty( $this->publishedTo ) &&
             ! $this->publishedTo->diff( $now )->invert )
        {
            return false;
        }

        if ( ! empty( $this->publishedFrom ) &&
             $this->publishedFrom->diff( $now )->invert )
        {
            return false;
        }

        return true;
    }
public function isPublished( $now = null )
    {
        if ( ! $this->published )
        {
            return false;
        }

        if ( empty( $now ) )
        {
            $now = new DateTime();
        }
        else
        {
            $now = $this->inputDate( $now );
        }

        if ( ! empty( $this->publishedTo ) &&
             ! $this->publishedTo->diff( $now )->invert )
        {
            return false;
        }

        if ( ! empty( $this->publishedFrom ) &&
             $this->publishedFrom->diff( $now )->invert )
        {
            return false;
        }

        return true;
    }
public function isPublished ( $ now = null ) { if ( ! $ this -> published ) { return false ; } if ( empty ( $ now ) ) { $ now = new DateTime ( ) ; } else { $ now = $ this -> inputDate ( $ now ) ; } if ( ! empty ( $ this -> publishedTo ) && ! $ this -> publishedTo -> diff ( $ now ) -> invert ) { return false ; } if ( ! empty ( $ this -> publishedFrom ) && $ this -> publishedFrom -> diff ( $ now ) -> invert ) { return false ; } return true ; }
Is published at a given time point

@param int|string|\DateTime $now default: null
@return bool
Is published at a given time point