• I was wondering if someone could help me change the format of my date and time.

    I’m trying to get the event’s time to show up on a separate line from the date.
    Right now, it’s “September 29, 2018 10:00am – 4:00pm”
    Is there anyway to make it:
    September 29, 2018
    10:00am – 4:00pm

    I looked in the event-meta-event-single.php file and came across the line, <li><strong><?php esc_html_e( 'Date', 'eventorganiser' );?>:</strong> <?php echo eo_format_event_occurrence();?></li>

    I just can’t figure out how to edit it after that. I went to the event-organiser-utility-functions.php file to see how, but if I make any changes in there, it’ll get overwritten when the plugin gets updated.

    Any help would be greatly appreciated. Thank you in advance.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • guillermovargasquisoboni

    (@guillermovargasquisoboni)

    Hello,

    First at all, you have to COPY the file event-meta-event-single.php and PASTE it on your theme’s folder. Then you can modify things directly on this file. It is not necessary to make any changes on the functions of the plugin.

    If you only need one day events, so you can use something like this :

    <?php if ( ! eo_recurs() ) { ?>
    			<!-- Single event -->
    			<li><strong><?php esc_html_e( 'Date', 'eventorganiser' );?>:</strong> <?php echo eo_get_the_start('F j, Y');?></li>
    			<li><strong><?php esc_html_e( 'Time' );?>:</strong> <?php echo eo_get_the_start('g:i a');?> - <?php echo eo_get_the_end('g:i a');?> </li>
    		<?php } ?>

    As you see, the function eo_format_event_occurrence(); is assembling date and time. You can also use the function eo_get_the_start() or eo_get_the_end() and use the date formats (definitions here: https://codex.www.ads-software.com/Formatting_Date_and_Time).

    Thread Starter achambers

    (@achambers)

    Thank you Guillermo. That’ll work for me!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Formatting events date and time’ is closed to new replies.