src/Helper/PageHelper.php
public function jsonPageIsActive($jsonString)
    {
        $page = json_decode($jsonString, true);

        $now = new \DateTime();

        $activeStart = array_key_exists('active_from', $page) ? new \DateTime($page['active_from']) : new \DateTime();
        $activeEnd = array_key_exists('active_to', $page) ? new \DateTime($page['active_to']) : new \DateTime();

        if ($now->getTimestamp() >= $activeStart->getTimestamp() &&
            $now->getTimestamp() <= $activeEnd->getTimestamp()
        ) {
            return $page['status'] == PageInterface::STATUS_PUBLISHED;
        }

        return false;
    }
public function jsonPageIsActive($jsonString)
    {
        $page = json_decode($jsonString, true);

        $now = new \DateTime();

        $activeStart = array_key_exists('active_from', $page) ? new \DateTime($page['active_from']) : new \DateTime();
        $activeEnd = array_key_exists('active_to', $page) ? new \DateTime($page['active_to']) : new \DateTime();

        if ($now->getTimestamp() >= $activeStart->getTimestamp() &&
            $now->getTimestamp() <= $activeEnd->getTimestamp()
        ) {
            return $page['status'] == PageInterface::STATUS_PUBLISHED;
        }

        return false;
    }
public function jsonPageIsActive ( $ jsonString ) { $ page = json_decode ( $ jsonString , true ) ; $ now = new \ DateTime ( ) ; $ activeStart = array_key_exists ( 'active_from' , $ page ) ? new \ DateTime ( $ page [ 'active_from' ] ) : new \ DateTime ( ) ; $ activeEnd = array_key_exists ( 'active_to' , $ page ) ? new \ DateTime ( $ page [ 'active_to' ] ) : new \ DateTime ( ) ; if ( $ now -> getTimestamp ( ) >= $ activeStart -> getTimestamp ( ) && $ now -> getTimestamp ( ) <= $ activeEnd -> getTimestamp ( ) ) { return $ page [ 'status' ] == PageInterface :: STATUS_PUBLISHED ; } return false ; }
Returns if a page is active or inactive based on json string from page snapshot.

@param $jsonString

@return bool
Returns if a page is active or inactive based on json string from page snapshot .