Forum

Thread tagged as: Question, Events

Auto creating & retreiving Event EndDate

I have the code below working just fine, but was wondering if anyone could give me some feedback to improve my method or is this okay to use? (I needed a default end time(+1 hour) for iCal and Google calendar buttons I'm generating in my events calendar.)

Thanks.

    $opts_meta = array(
            'filter'=>'eventSlug',
            'match'=>'eq',
            'value'=>perch_get('s'),
            'template'=>'listing/event-detail.html',
            'skip-template'=>'true'
        );

    $data_meta = perch_events_custom($opts_meta);

    $title = $data_meta[0]['eventTitle'];

    $eventEnd = $data_meta[0]['eventDateTime'];
    $eventEnd = strtotime($eventEnd) + 3600;
    $eventEnd = date('Y-m-d H:i:s', $eventEnd);

    PerchSystem::set_var('eventEnd', $eventEnd);


    perch_layout('events.above', array(
            'title'=> $title
Seth Girardin

Seth Girardin 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't see any problems there.

Seth which version of the calendar app does this work with?

Thanks

Thanks Drew.

Carol, I am running 1.9.2. I am hoping(begging) that 2016 brings the long awaited Events.app version 2 to life.