Home › Forums › Calendar Products › Events Calendar PRO › Events with start time but no end time
- This topic has 9 replies, 2 voices, and was last updated 10 years, 5 months ago by
Barry.
-
AuthorPosts
-
November 8, 2015 at 7:08 am #1023045
Adage
ParticipantHello,
I have want to set events that have only a starting time, and no ending time ; how should I manage to do this ?
Thank you.November 9, 2015 at 11:04 am #1023355Barry
MemberHi Adage,
If you create an event and leave the end date/time alone (basically, so that it matches the start date/time) then it should have the effect you’re looking for 🙂
Does that help?
November 9, 2015 at 11:55 am #1023390Adage
ParticipantJust great ! Thank you !
November 9, 2015 at 11:58 am #1023393Adage
ParticipantJust one more question : is it possible to show only the hours, and not the minutes ?
Like “next event today at 10h”
Thank you.November 9, 2015 at 1:24 pm #1023439Barry
MemberHi Adage,
By default the plugin simply uses the time format set up in WordPress’s Settings → General admin screen.
Changing this will however change the time format everywhere, which may not be your goal. The alternative is to customize things using the tribe_events_event_schedule_details_inner hook. Basic example:
function custom_event_schedule_format( $unused, $event_id ) { return tribe_get_start_date( $event_id, false, 'Y-m-d: h' ) . 'h'; } add_filter( 'tribe_events_event_schedule_details_inner', 'custom_event_schedule_format', 10, 2 );Of course, that’s a really simple example and you’d almost certainly want to tweak it to preserve the sort of date formatting you desire, but it should at least serve to outline the basic approach used to solve this sort of customization issue 🙂
November 9, 2015 at 1:25 pm #1023441Barry
Member(… Just to clarify, you would place that code either in your theme’s functions.php file or else in a custom plugin or some other suitable place 🙂 )
November 9, 2015 at 11:34 pm #1023600Adage
ParticipantHello and thank you,
In deed I need to custom the function.
Could you please show me where I can have more details on how to customise it ?
Thank you.November 10, 2015 at 7:18 am #1023717Barry
MemberHi Adage,
To understand date formats (such as what things like Y-m-d: h mean), please refer to the PHP manual – we’re using the same conventions.
Beyond that I’m afraid we have no specific resources on this, though you could certainly refer to our own code used for building the date/time (or “schedule”) information for each event, which can be found here:
The Events Calendar repo: tribe_events_event_schedule_details()
You could certainly reuse as much of that logic as you choose. I hope that helps 🙂
November 11, 2015 at 9:49 am #1024265Adage
ParticipantJust perfect ! Thank you very much !
November 11, 2015 at 4:11 pm #1024389Barry
MemberHappy to help 🙂
-
AuthorPosts
- The topic ‘Events with start time but no end time’ is closed to new replies.
