• Resolved shaunkrd

    (@shaunkrd)


    Hello,

    I have been trying to find a way to separate the date and the time elements from the output generated for a single event by the tribe_events_event_schedule_details() function. I have created a custom filter for 'tribe_events_event_schedule_details' and can add HTML around the date and time, but I can’t see a way of controlling the actual output of the date and time elements.

    It gets outputted all together like this:
    8 September 2017 @ 8:30 am – 5:30 pm

    My aim is just to display the date on one line styled in one way, with the time on a line below the date styled differently. Seems like it should be possible, but I haven’t found an example of how this can be done.

    I hope you can help by pointing me in the right direction.

    Many thanks,
    Shaun

    • This topic was modified 8 years, 2 months ago by shaunkrd.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Not sure what template structure you’re using but you could rewrite the function by using:

    tribe_get_start_date( null, false, 'j F Y' );
    This would give you a day-month-year output.

    tribe_get_start_date( null, false, 'H:i' );
    This outputs the hour-minutes.

    There’s also
    tribe_get_end_date
    Check the WP codex for examples on how you can build up your date structure.

    Hope that helps.

    • This reply was modified 8 years, 2 months ago by Eva.
    • This reply was modified 8 years, 2 months ago by Eva.

    +1 to that answer! Nice work, Eva, and thanks for sharing!

    Thread Starter shaunkrd

    (@shaunkrd)

    Thanks very much, Eva. I really appreciate you taking the time to share the code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to separate date and time in tribe_events_event_schedule_details() output’ is closed to new replies.