Event End Date in Archive

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 7 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24499 Reply

    I’m trying out the free version and would like to purchase the pro version, however I need to know if the placeholder tag can be modified somehow so the end date doesn’t display when the event occurs all in the same day, but does show when the event occurs over several days. I set the start and end date to display, but when an event is only on one day I would prefer it only show the start date.

    Thanks in advance for your response.

    Ellen
    #24534 Reply

    Hi Ellen,

    In what context? The event list shortcode and widget have seperate placeholders for the start and end date – but there isn’t (yet!) a placholder for the event range.

    The event pages templates on the other hand already show a date range. So an event on from 1pm-2pm on the same day would display as:

    5th October 1pm-2pm

    depending on your date format settings.

    Stephen Harris
    #25306 Reply

    I apologize, this question may have been me originally. I was swamped at the time I was testing this and it looks very much like a question I would have asked. I’ve done a bit of tinkering with the templates and am liking how this looks, so I’m almost ready to purchase. I’ve added a “Time” in the meta displayed on the single event page. However I’m back to the date challenge.

    We have some events that are recurring…great got that to work fabulously.

    But some, that begin and end on the same day at specific times. Currently it displays this way for recurring events:

    Event Details

    Date: December 16 to 17, 2016
    Time: 4:00pm to 9:00pm
    Venue: Café Manna
    Categories: Events
    

    For events that do not recur I see the start and end date: Event Details

    Date: December 31 to 31, 2016
    Time: 4:00pm to 9:00pm
    Venue: Café Manna
    Categories: Events
    

    I’d like it to omit the end date if it doesn’t recur.

    Here is my change to the template:

    <?php if ( ! eo_recurs() ) { ?> 
        <!-- Single event --> 
        <strong><?php esc_html_e( 'Date', 'eventorganiser' );?>:</strong> <?php echo eo_get_schedule_start("F j").' to '. eo_get_the_end("j, Y");?>
    <?php } ?>
    
    <?php if ( ! eo_recurs() ) { ?>
        <!-- Single event -->
        <li><strong><?php esc_html_e( 'Time', 'eventorganiser' );?>:</strong> <?php echo eo_get_schedule_start("g:ia").' to '. eo_get_the_end("g:ia");?></li>
    <?php } ?>
    

    Any direction you can give me would be appreciated. If I can get this working, my client will have me purchase the pro version.

    • This reply was modified 7 years, 4 months ago by  Stephen Harris.
    Ellen
    #25308 Reply

    Hi Ellen,

    I’ve edited your last reply as some of the code had been garbled by the forum. I think I have replicated what you originally intended, but please tell me if not (if you have trouble posting code, just post a link to your template file if you can).

    I should point out that the single event page is the same for all dates of an event. That is, unless the event is a single-occurrence one, the single event page doesn’t have a “date” to display. This is why, by default, the plug-in will list all dates of that event.

    It’s also why you should use eo_get_schedule_end() (last occurrence of the event) rather than eo_get_the_end() (the end date/time of an occurrence). You may find that you get unexpected behaviour with recurring events as you have it. If not, then you might be entering recurring events incorrectly (when creating an event the ‘End’ date/time refers to the end date/time of the first occurrence, you can then go on to repeat that until a certain date).

    In any case, if you don’t want an end date time for your single-occurrence events:

    <?php if ( ! eo_recurs() ) { ?> 
        <!-- Single event --> 
        <strong><?php esc_html_e( 'Date', 'eventorganiser' );?>:</strong> <?php echo eo_get_schedule_start("F j");
    <?php } ?>
    

    (simply remove the ' to '. eo_get_the_end("j, Y").

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Event End Date in Archive
Your information:




To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax


<a href="" title="" rel=""> <blockquote cite=""> <code> <pre> <em> <strong> <del datetime=""> <ul> <ol start=""> <li> <img src="" border="" alt="" height="" width=""> <p style=""> <span style="">