/**
  * Get the event date
  *
  * @param int $meta_id
  * @return string
  */
 public static function event_date($meta_id)
 {
     $time_format = get_option('time_format', TribeDateUtils::TIMEFORMAT);
     $start_time = tribe_get_start_date(null, false, $time_format);
     $end_time = tribe_get_end_date(null, false, $time_format);
     if (tribe_event_is_all_day()) {
         if (tribe_event_is_multiday()) {
             $html = Tribe_Meta_Factory::template(__('Start:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date()), $meta_id);
             $html .= Tribe_Meta_Factory::template(__('End:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_end_date()), $meta_id);
         } else {
             // If all day event, show only start date
             $html = Tribe_Meta_Factory::template(__('Date:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date()), $meta_id);
         }
     } elseif (tribe_event_is_multiday()) {
         // If multiday, show start date+time and end date+time
         $html = Tribe_Meta_Factory::template(__('Start:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date()), $meta_id);
         $html .= Tribe_Meta_Factory::template(__('End:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_end_date()), $meta_id);
     } else {
         // show start date
         $html = Tribe_Meta_Factory::template(__('Date:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr updated published dtstart" title="%s">%s</abbr>', tribe_get_start_date(null, false, TribeDateUtils::DBDATEFORMAT), tribe_get_start_date(null, false)), $meta_id);
         if ($start_time == $end_time) {
             // if start and end time are the same, just show the start time
             $html .= Tribe_Meta_Factory::template(__('Time:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), $start_time), $meta_id);
         } else {
             // show start and end time
             $html .= Tribe_Meta_Factory::template(__('Time:', 'tribe-events-calendar'), sprintf('<abbr class="tribe-events-abbr dtend" title="%s">%s</abbr>', tribe_get_end_date(null, false, TribeDateUtils::DBDATEFORMAT), $start_time . ' - ' . $end_time), $meta_id);
         }
     }
     return apply_filters('tribe_event_meta_event_date', $html);
 }
Exemple #2
0
 </dt>
			<dd>
				<abbr class="tribe-events-abbr updated published dtstart" title="<?php 
    esc_attr_e($start_ts);
    ?>
"> <?php 
    esc_html_e($start_date);
    ?>
 </abbr>
			</dd>



		<?php 
    // Multiday events
} elseif (tribe_event_is_multiday()) {
    ?>

			<dt> <?php 
    esc_html_e('Start:', 'the-events-calendar');
    ?>
 </dt>
			<dd>
				<abbr class="tribe-events-abbr updated published dtstart" title="<?php 
    esc_attr_e($start_ts);
    ?>
"> <?php 
    esc_html_e($start_datetime);
    ?>
 </abbr>
			</dd>
Exemple #3
0
 /**
  * End Date formatted for display
  *
  * Returns the event end date that observes the end of day cutoff
  *
  * @category Events
  * @param int    $event        (optional)
  * @param bool   $display_time If true shows date and time, if false only shows date
  * @param string $date_format  Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
  * @param string $timezone     Timezone in which to present the date/time (or default behaviour if not set)
  *
  * @return string|null Date
  */
 function tribe_get_display_end_date($event = null, $display_time = true, $date_format = '', $timezone = null)
 {
     $end_date = tribe_get_end_date($event, true, 'U', $timezone);
     $beginning_of_day = tribe_beginning_of_day(date(Tribe__Date_Utils::DBDATETIMEFORMAT, $end_date));
     if (tribe_event_is_multiday($event) && $end_date < strtotime($beginning_of_day)) {
         $end_date -= DAY_IN_SECONDS;
     }
     return tribe_format_date($end_date, $display_time, $date_format);
 }
Exemple #4
0
 /**
  * Return the details of the start/end date/time.
  *
  * The highest level means of customizing this function's output is simply to adjust the date format settings under
  * Events > Settings > Display, and WordPress time formats (via the General Settings admin screen).
  * Beyond that, however, there are two filters which can be used to exercise further control here.
  *
  * The first is 'tribe_events_event_schedule_details_formatting' which allows an array of format settings to be
  * altered - it's basic make-up is as a simple set of key:value pairs as follows.
  *
  * "show_end_time": for single day events only (not including all day events) it may not always be desirable to
  *     include the end time. In that situation, this setting can be set to false and the end time will not be
  *     displayed.
  *
  * "time": if it is undesirable to show times and only dates should be displayed then this setting can be set to
  *     false. If it is false it will by extension cause 'show_end_time' to be false.
  *
  * The resulting string can also be caught and manipulated, or completely overridden, using the
  * 'tribe_events_event_schedule_details' filter, should none of the above settings be sufficient.
  *
  * @category Events
  * @TODO use tribe_get_datetime_format() and related functions if possible
  *
  * @param int|null $event
  * @param string $before
  * @param string $after
  *
  * @return mixed|void
  */
 function tribe_events_event_schedule_details($event = null, $before = '', $after = '')
 {
     if (is_null($event)) {
         global $post;
         $event = $post;
     }
     if (is_numeric($event)) {
         $event = get_post($event);
     }
     $schedule = '<span class="date-start dtstart">';
     $format = '';
     $date_without_year_format = tribe_get_date_format();
     $date_with_year_format = tribe_get_date_format(true);
     $time_format = get_option('time_format');
     $datetime_separator = tribe_get_option('dateTimeSeparator', ' @ ');
     $time_range_separator = tribe_get_option('timeRangeSeparator', ' - ');
     $microformatStartFormat = tribe_get_start_date($event, false, 'Y-m-dTh:i');
     $microformatEndFormat = tribe_get_end_date($event, false, 'Y-m-dTh:i');
     $settings = array('show_end_time' => true, 'time' => true);
     $settings = wp_parse_args(apply_filters('tribe_events_event_schedule_details_formatting', $settings), $settings);
     if (!$settings['time']) {
         $settings['show_end_time'] = false;
     }
     extract($settings);
     $format = $date_with_year_format;
     // if it starts and ends in the current year then there is no need to display the year
     if (tribe_get_start_date($event, false, 'Y') === date('Y') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
         $format = $date_without_year_format;
     }
     if (tribe_event_is_multiday($event)) {
         // multi-date event
         $format2ndday = apply_filters('tribe_format_second_date_in_range', $format, $event);
         if (tribe_event_is_all_day($event)) {
             $schedule .= tribe_get_start_date($event, true, $format);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>' . $time_range_separator;
             $schedule .= '<span class="date-end dtend">';
             $schedule .= tribe_get_end_date($event, true, $format2ndday);
             $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
         } else {
             $schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>' . $time_range_separator;
             $schedule .= '<span class="date-end dtend">';
             $schedule .= tribe_get_end_date($event, false, $format2ndday) . ($time ? $datetime_separator . tribe_get_end_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
         }
     } elseif (tribe_event_is_all_day($event)) {
         // all day event
         $schedule .= tribe_get_start_date($event, true, $format);
         $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
     } else {
         // single day event
         if (tribe_get_start_date($event, false, 'g:i A') === tribe_get_end_date($event, false, 'g:i A')) {
             // Same start/end time
             $schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
         } else {
             // defined start/end time
             $schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>' . ($show_end_time ? $time_range_separator : '');
             $schedule .= '<span class="end-time dtend">';
             $schedule .= ($show_end_time ? tribe_get_end_date($event, false, $time_format) : '') . '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
         }
     }
     $schedule .= '</span>';
     $schedule = $before . $schedule . $after;
     return apply_filters('tribe_events_event_schedule_details', $schedule, $event->ID);
 }
 /**
  * Return the details of the start/end date/time.
  *
  * The highest level means of customizing this function's output is simply to adjust the date format settings under
  * Events > Settings > Display, and WordPress time formats (via the General Settings admin screen).
  * Beyond that, however, there are two filters which can be used to exercise further control here.
  *
  * The first is 'tribe_events_event_schedule_details_formatting' which allows an array of format settings to be
  * altered - it's basic make-up is as a simple set of key:value pairs as follows.
  *
  * "show_end_time": for single day events only (not including all day events) it may not always be desirable to
  *     include the end time. In that situation, this setting can be set to false and the end time will not be
  *     displayed.
  *
  * "time": if it is undesirable to show times and only dates should be displayed then this setting can be set to
  *     false. If it is false it will by extension cause 'show_end_time' to be false.
  *
  * The resulting string can also be caught and manipulated, or completely overridden, using the
  * 'tribe_events_event_schedule_details' filter, should none of the above settings be sufficient.
  *
  * @category Events
  * @TODO use tribe_get_datetime_format() and related functions if possible
  *
  * @param int|null $event
  * @param string $before
  * @param string $after
  *
  * @return mixed|void
  */
 function tribe_events_event_schedule_details($event = null, $before = '', $after = '')
 {
     if (is_null($event)) {
         global $post;
         $event = $post;
     }
     if (is_numeric($event)) {
         $event = get_post($event);
     }
     $inner = '<span class="tribe-event-date-start">';
     $format = '';
     $date_without_year_format = tribe_get_date_format();
     $date_with_year_format = tribe_get_date_format(true);
     $time_format = get_option('time_format');
     $datetime_separator = tribe_get_option('dateTimeSeparator', ' @ ');
     $time_range_separator = tribe_get_option('timeRangeSeparator', ' - ');
     $settings = array('show_end_time' => true, 'time' => true);
     $settings = wp_parse_args(apply_filters('tribe_events_event_schedule_details_formatting', $settings), $settings);
     if (!$settings['time']) {
         $settings['show_end_time'] = false;
     }
     /**
      * @var $show_end_time
      * @var $time
      */
     extract($settings);
     $format = $date_with_year_format;
     // if it starts and ends in the current year then there is no need to display the year
     if (tribe_get_start_date($event, false, 'Y') === date('Y') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
         $format = $date_without_year_format;
     }
     if (tribe_event_is_multiday($event)) {
         // multi-date event
         $format2ndday = apply_filters('tribe_format_second_date_in_range', $format, $event);
         if (tribe_event_is_all_day($event)) {
             $inner .= tribe_get_start_date($event, true, $format);
             $inner .= '</span>' . $time_range_separator;
             $inner .= '<span class="tribe-event-date-end">';
             $inner .= tribe_get_end_date($event, true, $format2ndday);
         } else {
             $inner .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $inner .= '</span>' . $time_range_separator;
             $inner .= '<span class="tribe-event-date-end">';
             $inner .= tribe_get_end_date($event, false, $format2ndday) . ($time ? $datetime_separator . tribe_get_end_date($event, false, $time_format) : '');
         }
     } elseif (tribe_event_is_all_day($event)) {
         // all day event
         $inner .= tribe_get_start_date($event, true, $format);
     } else {
         // single day event
         if (tribe_get_start_date($event, false, 'g:i A') === tribe_get_end_date($event, false, 'g:i A')) {
             // Same start/end time
             $inner .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
         } else {
             // defined start/end time
             $inner .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $inner .= '</span>' . ($show_end_time ? $time_range_separator : '');
             $inner .= '<span class="tribe-event-time">';
             $inner .= $show_end_time ? tribe_get_end_date($event, false, $time_format) : '';
         }
     }
     $inner .= '</span>';
     /**
      * Provides an opportunity to modify the *inner* schedule details HTML (ie before it is
      * wrapped).
      *
      * @param string $inner_html  the output HTML
      * @param int    $event_id    post ID of the event we are interested in
      */
     $inner = apply_filters('tribe_events_event_schedule_details_inner', $inner, $event->ID);
     // Wrap the schedule text
     $schedule = $before . $inner . $after;
     /**
      * Provides an opportunity to modify the schedule details HTML for a specific event after
      * it has been wrapped in the before and after markup.
      *
      * @param string $schedule  the output HTML
      * @param int    $event_id  post ID of the event we are interested in
      * @param string $before    part of the HTML wrapper that was prepended
      * @param string $after     part of the HTML wrapper that was appended
      */
     return apply_filters('tribe_events_event_schedule_details', $schedule, $event->ID, $before, $after);
 }
Exemple #6
0
 /**
  * Return the details of the start/end date/time
  *
  * @since 3.0
  * @param int|null $event
  * @return string
  */
 function tribe_events_event_schedule_details($event = null)
 {
     if (is_null($event)) {
         global $post;
         $event = $post;
     }
     if (is_numeric($event)) {
         $event = get_post($event);
     }
     $format = '';
     $timeFormat = get_option('time_format');
     $microformatStartFormat = tribe_get_start_date($event, false, 'Y-m-dTh:i');
     $microformatEndFormat = tribe_get_end_date($event, false, 'Y-m-dTh:i');
     // If the WordPress date setting matches DATEONLYFORMAT, make the string more readable
     if (get_option('date_format') == TribeDateUtils::DATEONLYFORMAT) {
         /* If the event happens this year, no need to show the year, unless it ends on another year (multi-day) */
         if (tribe_get_start_date($event, false, 'Y') === date('Y') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
             $format = 'F j';
         }
     }
     $schedule = '';
     if (tribe_event_is_multiday($event)) {
         // multi-date event
         $format2ndday = $format;
         // If the WordPress date setting matches DATEONLYFORMAT, make the string more readable
         if (get_option('date_format') == TribeDateUtils::DATEONLYFORMAT) {
             //If it's all day and the end date is in the same month and year, just show the day.
             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')) {
                 $format2ndday = 'j';
             }
         }
         if (tribe_event_is_all_day($event)) {
             // If the multi-day event begins and ends in the same month, just show the month once.
             if (tribe_get_end_date($event, false, 'm') === tribe_get_start_date($event, false, 'm') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             } else {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             }
         } else {
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ' @ ' . tribe_get_start_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span> - ';
             $schedule .= '<span class="date-end dtend">';
             $schedule .= tribe_get_end_date($event, false, $format2ndday) . ' @ ' . tribe_get_end_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
             $schedule .= '</span>';
         }
     } elseif (tribe_event_is_all_day($event)) {
         // all day event
         $schedule .= '<span class="date-start dtstart">';
         $schedule .= tribe_get_start_date($event, true, $format);
         $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
         $schedule .= '</span>';
     } else {
         // single day event
         if (tribe_get_start_date($event, false, 'g:i A') === tribe_get_end_date($event, false, 'g:i A')) {
             // Same start/end time
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ' @ ' . tribe_get_start_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>';
         } else {
             // defined start/end time
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ' @ ' . tribe_get_start_date($event, false, $timeFormat);
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span> - ';
             $schedule .= '<span class="end-time dtend">';
             $schedule .= tribe_get_end_date($event, false, $timeFormat) . '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
             $schedule .= '</span>';
         }
     }
     return apply_filters('tribe_events_event_schedule_details', $schedule);
 }
 /**
  * @deprecated
  */
 function tribe_is_multiday($postId = null)
 {
     _deprecated_function(__FUNCTION__, '3.0', 'tribe_event_is_multiday( $postId )');
     return apply_filters('tribe_is_multiday', tribe_event_is_multiday($postId));
 }
/**
 * Returns the event date, or today's date if the event has started and is not over yet.
 *
 * @return int
 **/
function tribe_events_get_widget_event_post_date()
{
    global $post, $wp_query;
    if (class_exists('Tribe__Events__Timezones')) {
        $startDate = Tribe__Events__Timezones::event_start_timestamp($post->ID, null);
        $endDate = Tribe__Events__Timezones::event_end_timestamp($post->ID, null);
    } else {
        $startDate = strtotime($post->EventStartDate);
        $endDate = strtotime($post->EventEndDate);
    }
    $is_multiday = tribe_event_is_multiday($post->ID);
    $is_all_day = tribe_event_is_all_day($post->ID);
    $today = current_time('timestamp');
    $yesterday = $today - DAY_IN_SECONDS;
    // Gets Yesterday cutoff to check which date we pick
    $yesterday_end = tribe_end_of_day(date(Tribe__Date_Utils::DBDATETIMEFORMAT, $yesterday), 'U') + 1;
    // Check if the yesterday cutoff will get the start date of the event
    if ($yesterday_end >= $startDate && !$is_multiday && !$is_all_day) {
        $postDate = $yesterday;
        // If the event starts way in the past or ends way in the future, let's show today's date
    } elseif ($today > $startDate && $today < $endDate) {
        $postDate = $today;
    } else {
        $postDate = $startDate;
    }
    /* If the user clicked in a particular day, let's show that day as the event date, even if the event spans a few days */
    if (defined('DOING_AJAX') && DOING_AJAX && isset($_POST['action']) && $_POST['action'] == 'tribe-mini-cal-day') {
        $postDate = strtotime($_POST['eventDate']);
    }
    return apply_filters('tribe_events_get_widget_event_post_date', $postDate);
}
Exemple #9
0
 /**
  * Return the details of the start/end date/time.
  *
  * The highest level means of customizing this function's output is simply to adjust the WordPress date and time
  * formats (via the General Settings admin screen). Beyond that however there are two filters which can be used to
  * exercise further control here.
  *
  * The first is 'tribe_events_event_schedule_details_formatting' which allows an array of format settings to be
  * altered - it's basic make-up is as a simple set of key:value pairs as follows.
  *
  * "datetime_separator": this is inserted between the date and the time and defaults to an ampersat @ character.
  *     Note that if you modify this you should ordinarily be careful to include leading and trailing spaces (an
  *     example might be ' at ').
  *
  * "same_year_format": if an event starts and ends in the same year it's assumed that including the year in the
  *     output is superfluous. That being the case the function changes the date format, by default, to 'F j'. This
  *     may not be ideal in all locales so an alternative can be provided here. Do note that this substitution is
  *     only ever made if A) the event starts and ends in the same year and B) the date format does not include any
  *     time formatting characters.
  *
  *     This can also effectively be used to turn off the assumption that the year should be omitted, simply by
  *     setting it to the value of the 'date_format' option, for example.
  *
  * "show_end_time": for single day events only (not including all day events) it may not always be desirable to
  *     include the end time. In that situation, this setting can be set to false and the end time will not be
  *     displayed.
  *
  * "time": if it is undesirable to show times and only dates should be displayed then this setting can be set to
  *     false. If it is false it will by extension cause 'show_end_time' to be false.
  *
  * The resulting string can also be caught and manipulated, or completely overridden, using the
  * 'tribe_events_event_schedule_details' filter, should none of the above settings be sufficient.
  *
  * @since 3.0
  * @param int|null $event
  * @return string
  */
 function tribe_events_event_schedule_details($event = null, $before = '', $after = '')
 {
     if (is_null($event)) {
         global $post;
         $event = $post;
     }
     if (is_numeric($event)) {
         $event = get_post($event);
     }
     $schedule = '';
     $format = '';
     $date_format = get_option('date_format');
     $time_format = get_option('time_format');
     $microformatStartFormat = tribe_get_start_date($event, false, 'Y-m-dTh:i');
     $microformatEndFormat = tribe_get_end_date($event, false, 'Y-m-dTh:i');
     $settings = array('datetime_separator' => ' @ ', 'same_year_format' => 'F j', 'show_end_time' => true, 'time' => true);
     $settings = wp_parse_args(apply_filters('tribe_events_event_schedule_details_formatting', $settings), $settings);
     if (!$settings['time']) {
         $settings['show_end_time'] = false;
     }
     extract($settings);
     // If the date format will result in the year being shown but does *not* include any time formatting...
     if (TribeDateUtils::formatContainsYear($date_format) && !TribeDateUtils::formatContainsTime($date_format)) {
         // ... and it starts and ends in the current year then there is no need to display the year
         if (tribe_get_start_date($event, false, 'Y') === date('Y') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
             $format = $same_year_format;
         }
     }
     if (tribe_event_is_multiday($event)) {
         // multi-date event
         $format2ndday = $format;
         // If the WordPress date setting matches DATEONLYFORMAT, make the string more readable
         if (get_option('date_format') == TribeDateUtils::DATEONLYFORMAT) {
             //If it's all day and the end date is in the same month and year, just show the day.
             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')) {
                 $format2ndday = 'j';
             }
         }
         if (tribe_event_is_all_day($event)) {
             // If the multi-day event begins and ends in the same month, just show the month once.
             if (tribe_get_end_date($event, false, 'm') === tribe_get_start_date($event, false, 'm') && tribe_get_end_date($event, false, 'Y') === date('Y')) {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             } else {
                 $schedule .= '<span class="date-start dtstart">';
                 $schedule .= tribe_get_start_date($event, true, $format);
                 $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
                 $schedule .= '</span> - ';
                 $schedule .= '<span class="date-end dtend">';
                 $schedule .= tribe_get_end_date($event, true, $format2ndday);
                 $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
                 $schedule .= '</span>';
             }
         } else {
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span> - ';
             $schedule .= '<span class="date-end dtend">';
             $schedule .= tribe_get_end_date($event, false, $format2ndday) . ($time ? $datetime_separator . tribe_get_end_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
             $schedule .= '</span>';
         }
     } elseif (tribe_event_is_all_day($event)) {
         // all day event
         $schedule .= '<span class="date-start dtstart">';
         $schedule .= tribe_get_start_date($event, true, $format);
         $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
         $schedule .= '</span>';
     } else {
         // single day event
         if (tribe_get_start_date($event, false, 'g:i A') === tribe_get_end_date($event, false, 'g:i A')) {
             // Same start/end time
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>';
         } else {
             // defined start/end time
             $schedule .= '<span class="date-start dtstart">';
             $schedule .= tribe_get_start_date($event, false, $format) . ($time ? $datetime_separator . tribe_get_start_date($event, false, $time_format) : '');
             $schedule .= '<span class="value-title" title="' . $microformatStartFormat . '"></span>';
             $schedule .= '</span>' . ($show_end_time ? ' - ' : '');
             $schedule .= '<span class="end-time dtend">';
             $schedule .= ($show_end_time ? tribe_get_end_date($event, false, $time_format) : '') . '<span class="value-title" title="' . $microformatEndFormat . '"></span>';
             $schedule .= '</span>';
         }
     }
     if (!empty($schedule)) {
         $schedule = $before . $schedule . $after;
     }
     return apply_filters('tribe_events_event_schedule_details', $schedule);
 }