示例#1
0
文件: date.php 项目: mpaskew/isc-dev
 /**
  * End Date
  *
  * Returns the event end date
  *
  * @param int $postId (optional) this only works for non recurring events
  * @param bool $displayTime If true shows date and time, if false only shows date
  * @param string $dateFormat Allows date and time formating using standard php syntax (http://php.net/manual/en/function.date.php)
  * @return string Date
  * @todo support $postId for recurring events.
  * @since 2.0
  */
 function tribe_get_end_date($postId = null, $displayTime = 'true', $dateFormat = '')
 {
     $postId = TribeEvents::postIdHelper($postId);
     if (!$postId || function_exists('tribe_is_recurring_event') && tribe_is_recurring_event($postId)) {
         global $post;
     } else {
         $post = get_post($postId);
     }
     if (tribe_get_all_day($postId)) {
         $displayTime = false;
     }
     if (empty($post->EventEndDate)) {
         $post->EventEndDate = tribe_get_event_meta($postId, '_EventEndDate', true);
     }
     if (isset($post->EventEndDate)) {
         $date = strtotime($post->EventEndDate);
     } else {
         return;
         // '—';
     }
     return tribe_event_format_date($date, $displayTime, $dateFormat);
 }
示例#2
0
 /**
  * @deprecated
  */
 function sp_get_all_day($postId = null)
 {
     _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_all_day()');
     return tribe_get_all_day($postId);
 }
示例#3
0
文件: list.php 项目: sonijoy/my_repo
            ?>
				<?php 
        } else {
            ?>
					<?php 
            the_content();
            ?>
				<?php 
        }
        ?>
			</div> <!-- End tribe-events-event-entry -->

			<div class="tribe-events-event-list-meta" itemprop="location" itemscope itemtype="http://schema.org/Place">
				<table cellspacing="0">
					<?php 
        if (tribe_is_multiday() || !tribe_get_all_day()) {
            ?>
					<tr>
						<td class="tribe-events-event-meta-desc"><?php 
            _e('Start:', 'tribe-events-calendar');
            ?>
</td>
						<td class="tribe-events-event-meta-value" itemprop="startDate" content="<?php 
            echo tribe_get_start_date();
            ?>
"><?php 
            echo tribe_get_start_date();
            ?>
</td>
					</tr>
					<tr>
 /**
  * Sort Events by Day
  *
  * Maps events to days of the month.
  *
  * @param array $results Array of events from tribe_get_events()
  * @param string $date
  * @return array Days of the month with events as values
  * @since 2.0
  */
 function tribe_sort_by_month($results, $date)
 {
     global $post;
     $cutoff_time = tribe_get_option('multiDayCutoff', '12:00');
     if (preg_match('/(\\d{4})-(\\d{2})/', $date, $matches)) {
         $queryYear = $matches[1];
         $queryMonth = $matches[2];
     } else {
         return false;
         // second argument not a date we recognize
     }
     $monthView = array();
     for ($i = 1; $i <= 31; $i++) {
         $monthView[$i] = array();
     }
     foreach ($results as $event) {
         $post = $event;
         $started = false;
         list($startYear, $startMonth, $startDay) = explode('-', $event->EventStartDate);
         list($endYear, $endMonth, $endDay) = explode('-', $event->EventEndDate);
         list($startDay, $garbage) = explode(' ', $startDay);
         list($endDay, $garbage) = explode(' ', $endDay);
         for ($i = 1; $i <= 31; $i++) {
             $curDate = strtotime($queryYear . '-' . $queryMonth . '-' . $i);
             if ($i == $startDay && $startMonth == $queryMonth || strtotime($startYear . '-' . $startMonth) < strtotime($queryYear . '-' . $queryMonth)) {
                 $started = true;
             }
             // if last day of multiday event
             if (!tribe_get_all_day() && tribe_is_multiday($event->ID) && date('Y-m-d', $curDate) == date('Y-m-d', strtotime($event->EventEndDate))) {
                 $endTime = strtotime(date('Y-m-d', $curDate) . date('h:i A', strtotime($event->EventEndDate)));
                 $cutoffTime = strtotime(date('Y-m-d', $curDate) . $cutoff_time . "AM");
                 // if end time is before cutoff, then don't show
                 if ($endTime <= $cutoffTime) {
                     $started = false;
                 }
             }
             if ($started) {
                 $monthView[$i][] = $event;
             }
             if ($i == $endDay && $endMonth == $queryMonth) {
                 continue 2;
             }
         }
     }
     return $monthView;
 }
示例#5
0
$class = ob_get_contents();
ob_end_clean();
?>
<li <?php 
echo $class;
?>
>
	<div class="when">
		<?php 
$space = false;
$output = '';
echo tribe_get_start_date($post->ID);
if ($end && $event->EndDate != '') {
    if (tribe_get_all_day($post->ID) != 'yes' && tribe_is_multiday($post->ID) || tribe_get_all_day($post->ID) == 'yes' && tribe_is_multiday($post->ID)) {
        echo ' – <br/>' . tribe_get_end_date($post->ID);
    } elseif (tribe_get_all_day($post->ID) != 'yes' && !tribe_is_multiday($post->ID)) {
        echo ' – <br/>' . tribe_get_end_date($post->ID, false, 'g:i a');
    }
}
if ($event->AllDay) {
    echo ' <small><em>(' . __('All Day', 'tribe-events-calendar-pro') . ')</em></small>';
}
?>
	</div>
	<div class="event">
		<a href="<?php 
echo tribe_get_event_link($post);
?>
"><?php 
echo $post->post_title;
?>
示例#6
0
</h4>
				<?php 
        }
        ?>
				<?php 
        the_title('<h2 class="entry-title" itemprop="name"><a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark" itemprop="url">', '</a></h2>');
        ?>
				<div class="entry-content tribe-events-event-entry" itemprop="description">
					<?php 
        has_excerpt() ? the_excerpt() : the_content();
        ?>
				</div> <!-- End tribe-events-event-entry -->
				<div class="tribe-events-event-list-meta">
					<table>
						<?php 
        if (tribe_is_multiday() || tribe_get_all_day() != 'yes') {
            ?>
						<tr>
							<td class="tribe-events-event-meta-desc"><?php 
            _e('Start:', 'tribe-events-calendar-pro');
            ?>
</td>
							<td class="tribe-events-event-meta-value"><meta itemprop="startDate" content="<?php 
            echo tribe_get_start_date(null, false, 'Y-m-d');
            ?>
" /><?php 
            echo tribe_get_start_date();
            ?>
</td>
						</tr>
						<tr>