I need to display the dates for events in this format: “1 Oct” for a single day event and “1 to 2 Oct” for a multi-day event. The code I have so far works except on single day events that aren’t All Day Events. For that situation, my code outputs “1 to 1 Oct”. I assume it’s because the start time does not equal the end time. How do I change this so it compares only the date and not the time?
<?php echo tribe_get_start_date( null, false, 'j' ); ?> <!-- display start date -->
<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?> <!-- if start/end dates are different -->
to <?php echo tribe_get_end_date( null, false, 'j' ); ?> <!-- display end date -->
<?php } ?>
<br>
<?php echo tribe_get_start_date( null, false, 'M' ); ?> <!-- display month -->