End Date
-
When having an event for a set time on a day for instance 8:30am to 12:30am in the list it shows the date twice, is there anyway to hide the end date as it looks a little messy on the events list?
-
You can do this by editing the code and using display:none in the CSS for the end date
It won’t look so clever on multi-day events: you can code a way round this if you want to
Nick Froome
Thanks for you speedy reply and your suggestion. How would I go about coding it to still have the date in a multi day event? I don’t mind making a small donation
One way would be to compare the two dates using PHP and using an IF statement
So If startdate=enddate; display nothing; otherwise display enddate
Syntax is here:
http://www.w3schools.com/php/php_if_else.aspThe other way would be to use the tribe_is_multiday value to switch on & off the second date
The PHP for the list is in
wordpress/wp-content/plugins/the-events-calendar/views/list.phpThe best way to edit it is to copy list.php to a new folder “events” here:
wordpress/wp-content/themes/your-theme-name/events/list.phpThat is an override location: edit the PHP there and not in the original location
Nick Froome
Hi Nick sorry I am being a complete fool, its the widget on the homepage I need to hide the end date on single day event. I know I need to edit the formating of the tribe_get_end_date field as this is complete string that is displayed but cannot see where. So greatful for your help
its ok have sorted it, changed the coding on the widget that it hides the end date and time unless it is a allday event then it will display it.
Thanks for helping out with this one, Nick!
scuzzie2k: sounds like you got this sorted, correct? Just want to double check…I’m going to mark this Resolved but let me know if I’ve misunderstood or you need anything else. Cheers and thanks for using The Events Calendar.
This has all been resolved so yes go ahead and close. Thanks
Excellent! Thanks for confirming, scuzzle2k. Thanks again for using The Events Calendar and for your support so far. If you need anything else in the future please let us know.
So which css file do you edit to delete endtime on the widget? I am searching events.css but cannot find anything. Maybe I missed something.
Hi you need to edit the file ‘events-list-load-widget-display.php’ and delete the line around 48/49 that reads {
echo ‘ –
‘. tribe_get_end_date($post->ID);
}
}’Hello,
I’m trying to do the if statement and I almost have it but I can’t get the display none to work. This is what I have$event ->EndDate==$event ->StartDate ;
if ($event ->EndDate ) {This is what mine reads with line numbers:
47
48 if( $event->AllDay ) {
49 echo ‘ <small>(‘.__(‘All Day’,’tribe-events-calendar’).’)</small>’;
50 }I tried following along with you all and tried the suggestion of scuzzie2k but for lines 47-50 but all i get is the date with the start time. The end time isn’t there. What am I doing wrong?
Also, anyone happen to know how to get rid of the “View All Events” from the widget? I don’t see it in the PHP file. Thanks.
The topic ‘End Date’ is closed to new replies.