WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] Calendar View Tool Tip - Event Dates (14 posts)

  1. thinkdm2
    Member
    Posted 1 year ago #

    Right Now if the Event is just one (1) day, the date and time displays like below:

    "Month 00, 0000 0:00 pm - 00:00 pm"

    And if it is multiple days, it displays like this:

    "Month 00, 0000 0:00 pm - Month 00, 0000 00:00 pm"

    This makes it appear to run continuously from the start day and time to the end day and time.

    I would like it to output like shown below, while still displaying the single day event as it is above:

    "Month 00 - 00, 0000 0:00 pm - 00:00 pm"

    Can someone help me with this?

    Thanks!

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

    [No bumping, thank you.]

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hi again thinkdm2. Thanks for the note. This is actually a bug with the current release; we've got a fix in the works that should be released in the 2.0.10 build when that comes out between now and the end of the month.

    Hope that helps and sorry I couldn't offer up more in the short-term. Relief is on the way for this, though.

  3. thinkdm2
    Member
    Posted 1 year ago #

    Ah, ok. Well, in the meantime, maybe you can help me out with a similar issue I am trying to resolve.

    In 'List' view, I am trying to create an if/else statement for the date, but since I have little to no knowledge of PHP, I cannot get it to work.

    Here is what I am trying to do:

    If the event runs over multiple days in the same month, I would like it to display like this:

    "Month 00 - 00, 0000 0:00 pm - 00:00 pm"

    BUT, if the event runs over multiple days over two different months, I would like it to display like this:

    "Month 00 - Month 00, 0000 0:00 pm - 00:00 pm"

    Here is my poor attempt at a PHP if/else statement, comparing the start date month to the end date month:

    <?php if ( tribe_is_multiday() && !tribe_is_day() ) : ?>
    
                    <?php if ( tribe_get_start_date('F') !== tribe_get_end_date('F') ) : ?>
                    	<h4 class="event-day"><?php echo tribe_get_start_date( null, false, 'F j' ); ?> &ndash; <?php echo tribe_get_end_date( null, false, 'F j, Y' ); ?> &ndash; <?php echo tribe_get_start_date( null, false, 'g:ia' ); ?></h4>
    
                	<?php else: ?>
                    	<h4 class="event-day"><?php echo tribe_get_start_date( null, false, 'F j' ); ?> - <?php echo tribe_get_end_date( null, false, 'j, Y' ); ?> &ndash; <?php echo tribe_get_start_date( null, false, 'g:ia' ); ?></h4>
    
                    <?php endif; ?>
    
                <?php endif; ?>
  4. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey again thinkdm2. Sure thing; while this is a bit outside my area of expertise, I can get Jonah from our team to take a look. While I can't guarantee anything here - as this is more in the realm of customization than we're generally able to support here - if he can point you in the right direction after looking at this for a few minutes, he definitely will.

    Thanks for your support and patience so far. You should hear from Jonah here no later than tomorrow; but please let me know if you need anything else in the interim.

  5. jonahcoyote
    Member
    Posted 1 year ago #

    Hey thinkdm2,

    You were very close... Try this instead:

    <?php if( !tribe_is_day() && tribe_is_multiday() ) : ?>
    
    				<?php
    				$start_date = tribe_get_start_date('F');
    				$end_date = tribe_get_end_date('F');
    				//echo $start_date;
    				//echo $end_date;
    
    				if ( tribe_get_end_date('F') != tribe_get_start_date('F') ) : ?>
             	<h4 class="event-day"><?php echo tribe_get_start_date( null, false, 'F j' ); ?> &ndash; <?php echo tribe_get_end_date( null, false, 'F j, Y' ); ?> &ndash; <?php echo tribe_get_start_date( null, false, 'g:ia' ); ?></h4>
             	This event does not end on this month!
            <?php else: ?>
             	<h4 class="event-day"><?php echo tribe_get_start_date( null, false, 'F j' ); ?> - <?php echo tribe_get_end_date( null, false, 'j, Y' ); ?> &ndash; <?php echo tribe_get_start_date( null, false, 'g:ia' ); ?></h4>
            <?php endif; ?>
    
    			<?php endif; ?>

    I added some debug in there as well that may help. Does that work?

    - Jonah

  6. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey again thinkdm2...just wanted to follow-up on this. Need anything else from us after reviewing Jonah's last note?

  7. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    I'm going to go ahead and mark this resolved, thinkdm2, since we haven't heard back and will assume you got this sorted. If you disagree please let me know. Thanks again for using The Events Calendar!

  8. thinkdm2
    Member
    Posted 1 year ago #

    Sorry, for the no response. This project was put on hold for awhile.

    Back on it today, so I will give it a try.

    Jonah, thanks for taking the time to correct my code and providing the solution that I needed.

  9. thinkdm2
    Member
    Posted 1 year ago #

    Jonah, I'm afraid that this is still not working.

    All of the events are still showing the month on both the start and ending dates, regardless if they are different or the same.

    Any suggestions?

  10. jonahcoyote
    Member
    Posted 1 year ago #

    Hey thinkdm2,

    Did you try applying the 2.0.10 update and did this fix this? Make sure you remove any changes you made in overrides by renaming the files to .OLD or something like that. Otherwise the plugin will still be using your overridden version and not the updated files from 2.0.10

    - Jonah

  11. thinkdm2
    Member
    Posted 1 year ago #

    No, I only replaced my code with your code in my files that are in a folder named 'events' in my theme folder.

  12. jonahcoyote
    Member
    Posted 1 year ago #

    Did you update to 2.0.10? Please do if not and remove any overrides in the 'events' folder by renaming the folder temporarily to 'eventsOLD'.

    - Jonah

  13. thinkdm2
    Member
    Posted 1 year ago #

    I got it working.

    Thanks for your help, Jonah!

  14. jonahcoyote
    Member
    Posted 1 year ago #

    Glad to hear! Let us know if you need anything else.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic