Skip to content

Instantly share code, notes, and snippets.

@jazbek
Created August 22, 2014 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jazbek/cd30fea9c9c46aeb134e to your computer and use it in GitHub Desktop.
Save jazbek/cd30fea9c9c46aeb134e to your computer and use it in GitHub Desktop.
Restore day-only format for 2nd date in a date range in the same month
<?php
add_filter( 'tribe_format_second_date_in_range', 'tribe_restore_no_month_format', 10, 2 );
function tribe_restore_no_month_format( $format, $event ) {
if ( tribe_event_is_all_day( $event ) && tribe_get_end_date( $event, false, 'm' ) === tribe_get_start_date( $event, false, 'm' ) && tribe_get_end_date( $event, false, 'Y' ) === date( 'Y' ) ) {
$format = 'j';
}
return $format;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment