Listing event records under a date

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 2, 2013   (RSS)

By Djulia - April 2, 2013 - edited: April 2, 2013

Hello,

Here an approach, it is proposed at the origin by Damon.
http://www.interactivetools.com/forum/forum-posts.php?postNum=2216242#post2216242


<?php foreach ($calendar_events as $record): ?>
<?php $date = date("Y-m", strtotime($record['date'])); ?>
<?php if (@$lastDate != $date): ?>
<?php endif ?>

    <?php $dateHour = date("Y-m-d", strtotime($record['date'])); ?>
    <?php if (@$lastDateHour != $dateHour): ?>
    <br />
    <b><?php echo date("l, F j", strtotime($record['date'])); ?></b>
    <br />
    <?php endif ?>

  
       <?php echo date("g:i a", strtotime($record['date'])) ?> 
          (<?php echo $record['duration:label'] ?>) - <a href="#" class="tooltip" title="<?php echo $lessonsRecord['content']; ?> <?php echo htmlencode($record['content']) ?>"><?php echo $record['title:label'] ?></a><br />

    <?php $lastDateHour = $dateHour; ?>

<?php $lastDate = $date; ?>
<?php endforeach; ?>

You must use :

'orderBy' => 'date DESC',

Hope that helps!

Djulia