Read time and weekly recurrence

This topic contains 2 replies, has 2 voices, and was last updated by  Stephen Harris 10 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10128

    Hi

    I get event via ical sync and need a bit more information….. For example….

    Event who is every Monday from 6pm to 7.30pm recurs 6 times every week.

    so i want to read out the time how long the evnt is. In this case ….

    6 times, 1.5 hours

    I try it with some code snips but dont get the right result.

    <?php

    $datetime1 = new DateTime(‘2009-10-11’);
    $datetime2 = new DateTime(‘2009-10-13’);
    $interval = $datetime1->diff($datetime2);
    echo $interval->format(‘%R%a days’);
    ?>

    or

    <?php echo eo_get_the_start('H:i'). - .eo_get_the_end('H:i')." hr"; ?>

    Here i always got “0hr”

    Thx

    Wolfgang Kronlachner
    #10134

    Hi

    Cool, solve the first problem by my one. Have to write this coder….

    <?php echo eo_get_the_end('H:i') - eo_get_the_start('H:i')." hr"; ?>

    and the sum is correct 🙂 . Next step—— make a short code from this—-oh my god

    So i only need to know where i get the info how many times the event reccurs!?!

    Greetz

    Wolfgang Kronlachner
    #10135

    Hi Wolfgang,

    You can get all the recurrence schedule details from eo_get_event_schedule(). (see function reference). But if you’re just after the number of occurrences:

    $num = count( eo_get_the_occurrences_of() );
    Stephen Harris
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.