<?php
    $current_date = '';
?>
<?php foreach ($data as $i => $row): ?>
<?php $date = $row['date'] ?>
<?php $time = $row['time'] ?>
<?php if ($current_date != $date): ?>
<?php $current_date = $date; ?>
<div class="short-news-date">
    <?php echo $current_date ?>
</div>
<div class="short-news-chunk">
<?php endif; ?>
<div class="similar-row">
    <?php echo $time ?>        
    <a href="<?php echo htmlspecialchars($row['link']) ?>">
        <?php echo $row['title'] ?>
    </a>
</div>
<?php if (isset($data[($i+1)]) ? ($current_date != $data[($i+1)]['date']) : true): ?>
</div>
<?php endif; ?>
<?php endforeach; ?>

<?php if (!empty($pager)): ?>
<?php echo $pager; ?> 
<?php endif; ?>