Support

Home Forums Event Espresso Premium Date format (4)

Date format (4)

Posted: August 14, 2016 at 1:08 pm


KristofRisingHeart

August 14, 2016 at 1:08 pm

Dear All,

I’m currently running into a problem with event espresso.

I would like to show the event date on the Event page. In the same way as the Blog layout. I managed to get the event date working by copying over the responsible function to my functions.php file.

function espresso_event_date( $date_format = 'M Y',  $EVT_ID = FALSE, $echo = TRUE ) {
  $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
  $date_format = apply_filters( 'FHEE__espresso_event_date__date_format', $date_format );
  if($echo){
      echo EEH_Event_View::the_event_date( $date_format, $EVT_ID );
    return '';
  }
  return EEH_Event_View::the_event_date( $date_format, $EVT_ID );
}

I used a do action to show the date in the content-espresso-dates-times-styled.php file (this is a arabica template that i modified)

do_action( 'AHEE_event_details_before_event_date', $post );

The date is shown in Unix format i think. Its showing as a number 705.
Any ideas on how i could get it to show the day /month / year /

Thanks in advance for your kind help.

  • This topic was modified 7 years, 7 months ago by  KristofRisingHeart.
  • This topic was modified 4 years, 1 month ago by  Garth.


KristofRisingHeart

August 14, 2016 at 1:17 pm

Please find a screenshot below.

Screenshot of the output on the page.


KristofRisingHeart

August 14, 2016 at 4:43 pm

Figured it out. 🙂

Created new functions and just called them in the template.

function espresso_event_startdate( $startdate_format = '', $EVT_ID = FALSE, $echo = TRUE ) {
  $startdate_format = ! empty( $startdate_format ) ? $startdate_format : ('d');
  $startdate_format = apply_filters( 'FHEE__espresso_event_date__date_format', ('d') );
  if($echo){
    echo EEH_Event_View::the_event_date( $startdate_format, $EVT_ID );
    return '';
  }
  return EEH_Event_View::the_event_date( $startdate_format, $EVT_ID );

}

The support post ‘Date format (4)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso