private function checkIsCampaignStarted($node) {
    // Campaign timezone.
    $campaignTimezone = new \DateTime($node->get('field_campaign_timezone')->getString());
    $campaignTimezone = $campaignTimezone->getTimezone();

    // All time of campaign.
    $localeCampaignStart = OpenYLocaleDate::createDateFromFormat($node->get('field_campaign_start_date')->getString());
    $localeCampaignStart->convertTimezone($campaignTimezone);

    // Current dates. + labels with dates.
    $localTime = OpenYLocaleDate::createDateFromFormat(date('c'));
    $localTime->convertTimezone($campaignTimezone);

    return $localTime > $localeCampaignStart;
  }
private function checkIsCampaignStarted($node) {
    // Campaign timezone.
    $campaignTimezone = new \DateTime($node->get('field_campaign_timezone')->getString());
    $campaignTimezone = $campaignTimezone->getTimezone();

    // All time of campaign.
    $localeCampaignStart = OpenYLocaleDate::createDateFromFormat($node->get('field_campaign_start_date')->getString());
    $localeCampaignStart->convertTimezone($campaignTimezone);

    // Current dates. + labels with dates.
    $localTime = OpenYLocaleDate::createDateFromFormat(date('c'));
    $localTime->convertTimezone($campaignTimezone);

    return $localTime > $localeCampaignStart;
  }
private function checkIsCampaignStarted ( $ node ) { // Campaign timezone. $ campaignTimezone = new \ DateTime ( $ node -> get ( 'field_campaign_timezone' ) -> getString ( ) ) ; $ campaignTimezone = $ campaignTimezone -> getTimezone ( ) ; // All time of campaign. $ localeCampaignStart = OpenYLocaleDate :: createDateFromFormat ( $ node -> get ( 'field_campaign_start_date' ) -> getString ( ) ) ; $ localeCampaignStart -> convertTimezone ( $ campaignTimezone ) ; // Current dates. + labels with dates. $ localTime = OpenYLocaleDate :: createDateFromFormat ( date ( 'c' ) ) ; $ localTime -> convertTimezone ( $ campaignTimezone ) ; return $ localTime > $ localeCampaignStart ; }
Check if Campaign has already started.

@param $node Node Campaign node object.

@return bool
Check if Campaign has already started .