length of event???

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10101

    Hi!

    How is it possible to get the lengh of an event who is loading per google feed and show this in the event list.?

    Thanks for help

    Wolfgang Kronlachner
    #10136

    This depends on what you want to find the length of: (i) an occurrence, (ii) difference between the start of the first and start of the last occurrence

    By editing the event list (shortcode/widget) templates you can use use DateInterval‘s format method (see php’s reference). This php5.3+ (which I noticed you are using from a previous post). For those who are not running on php5.2 you can use eo_date_interval() instead.

    For (i):

     $date1 = eo_get_the_start( DATETIMEOBJ );
     $date2 = eo_get_the_end( DATETIMEOBJ );

    For (ii):

     $date1 = eo_get_schedule_start( DATETIMEOBJ );
     $date2 = eo_get_schedule_last( DATETIMEOBJ );

    And then to print the difference:

    echo eo_date_interval( $date1, $date2, '%d days %h hours %i minutes' );

    Alternatively, and if you want the length of each occurrence you can use the shortcode template tag:

    %event_duration{%d days %h hours %i minutes}%
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 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.