WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] End Date (14 posts)

  1. scuzzie2k
    Member
    Posted 1 year ago #

    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?

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. bolide
    Member
    Posted 1 year ago #

    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

  3. scuzzie2k
    Member
    Posted 1 year ago #

    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

  4. bolide
    Member
    Posted 1 year ago #

    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.asp

    The 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.php

    The 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.php

    That is an override location: edit the PHP there and not in the original location

    Nick Froome

  5. scuzzie2k
    Member
    Posted 1 year ago #

    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

  6. scuzzie2k
    Member
    Posted 1 year ago #

    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.

  7. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    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.

  8. scuzzie2k
    Member
    Posted 1 year ago #

    This has all been resolved so yes go ahead and close. Thanks

  9. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    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.

  10. koufuki77
    Member
    Posted 1 year ago #

    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.

  11. scuzzie2k
    Member
    Posted 1 year ago #

    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);
    }
    }'

  12. capcu
    Member
    Posted 1 year ago #

    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 ) {

  13. scuzzie2k
    Member
    Posted 1 year ago #

    This is what mine reads with line numbers:

    47
    48 if( $event->AllDay ) {
    49 echo ' <small>('.__('All Day','tribe-events-calendar').')</small>';
    50 }

  14. jaegergirl
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic