Skip to content

Instantly share code, notes, and snippets.

@chadsten
Created July 16, 2013 19:32
Show Gist options
  • Select an option

  • Save chadsten/6011879 to your computer and use it in GitHub Desktop.

Select an option

Save chadsten/6011879 to your computer and use it in GitHub Desktop.
<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
<?php if (!$label_hidden): ?>
<div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
<?php endif; ?>
<div class="altered field-items"<?php print $content_attributes; ?>>
<?php dpm($items); ?>
<?
list($start, $end) = explode(' to ', $items[0]['#markup']);
list($start_date, $start_time) = explode(' ', $start);
list($end_date, $end_time) = explode(' ', $end);
$start = strtotime($start);
echo format_date($start, 'custom', 'human_time');
?>
<div class="date-time-wrapper date">
<span class="date-time date from"><?= $start_date; ?></span>
<?php if ($end_date && $start_date != $end_date) { ?> <span class="separator"> - </span><span class="date-time date to"><?= $end_date; ?></span> <?php } ?>
</div>
<div class="date-time-wrapper time">
<span class="date-time time from"><?= $start_time; ?></span>
<?php if ($end_time) { ?><span class="separator"> - </span><span class="date-time time to"><?= $end_time; ?></span> <?php } ?>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment