Home › Forums › Ticket Products › Event Tickets Plus › Single Event Date/Time
- This topic has 6 replies, 3 voices, and was last updated 9 years, 3 months ago by
Norbert.
-
AuthorPosts
-
January 14, 2017 at 4:43 am #1218548
Norbert
ParticipantHi, is there a way to display date and time seperate? I found the funktion tribe_events_event_schedule_details. Is the a funktion to return the date without time? I need to display the time at another place in a different style.
All the best
NorbertJanuary 16, 2017 at 1:14 pm #1219198Nico
MemberHi there Norbert,
Thanks for getting in touch with us! I can help you on this 🙂
is there a way to display date and time seperate?
Sure, if you want to use ‘tribe_events_event_schedule_details’ you can use the filter ‘tribe_events_event_schedule_details_formatting’ to modify the arguments of ‘show end time’ and ‘time’. You’ll need to this conditionaly, not sure where you want to use this function with the time, Can you please let me know about it?
Another option is to use tribe_get_start_date and tribe_get_end_date, which have parameters to control the formatting of the output.
Please let me know if this helps,
Best,
NicoJanuary 18, 2017 at 3:49 am #1220170Norbert
ParticipantHi, Nico, thank you for response but sorry, but I don’t know what filter means.
My requirement is to display the date. Without time. That means the day and the month like “18. January” and nothing else. Your suggestion tribe_get_start_date displays “18. January 20:30 Uhr”.
On the other hand I have to display the time. Without showing the day and the month. For example to display day/month at the top of the page and the start time at the foot.January 23, 2017 at 4:57 pm #1222632Nico
MemberThanks for following up Norbert!
…sorry, but I don’t know what filter means…
No problem! You can find more information about filters & actions here → http://blog.teamtreehouse.com/hooks-wordpress-actions-filters-examples
My requirement is to display the date. Without time. That means the day and the month like “18. January” and nothing else. Your suggestion tribe_get_start_date displays “18. January 20:30 Uhr”. On the other hand I have to display the time. Without showing the day and the month. For example to display day/month at the top of the page and the start time at the foot.
Both functions tribe_get_start_date and tribe_get_end_date, accept a date format parameter (more details on the PHP date format). So for example you can the functions this way to get your desired result:
// get just the date
echo tribe_get_start_time ( $event_id, 'd. F');// get just the time
echo tribe_get_start_time ( $event_id, 'H:i');
The first parameter of the function is the event ID. You can pass ‘null’ and the function will try to figure out the value.
One last thing please note you can also change how dates are displayed in ‘WP-Admin > Events > Settings > Display > Date Format Settings’. This won’t help you with the requirement you mentioned but might help with general formatting across the site!
Please let me know if this helps,
Best,
NicoJanuary 24, 2017 at 6:14 am #1222899Norbert
ParticipantNico, thank you, this works perfect!!! And thanks for the tip! I will break in filtering so I won’t bother you with such stuff 😉 maybe …
January 24, 2017 at 8:29 am #1222968Nico
MemberStoked to hear Norbert 🙂
No problem, just reach out when you need help. But learning a bit about filters and actions will surely payoff! It’s the base of WordPress!
I’ll go ahead and close out this thread.
Have a great a week,
Nico -
AuthorPosts
- The topic ‘Single Event Date/Time’ is closed to new replies.
