/** * Automatically handles TimeAgo for UTC * * @param mxied $date Likely a string in date format (of some kind) * @param string $format The format we want to FORCE the dts to be formatted to * If this isn't supplied, we'll pull it from Cii::getConfig() * @return CHtml:tag span element */ public static function timeago($date, $format = NULL) { Yii::app()->controller->widget('vendor.yiqing-95.YiiTimeAgo.timeago.JTimeAgo', array('selector' => ' .timeago', 'useLocale' => false, 'settings' => array('refreshMillis' => 60000, 'allowFuture' => true, 'strings' => array('prefixAgo' => null, 'prefixFromNow' => null, 'suffixAgo' => "ago", 'suffixFromNow' => "from now", 'seconds' => "less than a minute", 'minute' => "about a minute", 'minutes' => "%d minutes", 'hour' => "about an hour", 'hours' => "about %d hours", 'day' => "a day", 'days' => "%d days", 'month' => "about a month", 'months' => "%d months", 'year' => "about a year", 'years' => "%d years", 'wordSeparator' => " ", 'numbers' => array())))); return CHtml::tag('span', array('class' => "timeago", 'style' => 'text-decoration:none; cursor: default', 'rel' => 'tooltip', 'data-original-title' => Cii::formatDate($date, $format), 'title' => CTimestamp::formatDate('c', $date)), Cii::formatDate($date, $format)); }
echo CHtml::encode($comment->parent->author->name); ?> • <?php } else { ?> • <?php } ?> <time class="timeago" datetime="<?php echo date(DATE_ISO8601, strtotime($comment->created)); ?> "> <?php echo Cii::formatDate($comment->created); ?> </time> </div> <div class="comment-body"> <?php if ($comment->approved == -2) { ?> <em class="flagged"><?php echo Yii::t('DefaultTheme', 'Comment has been redacted'); ?> </em> <?php } else { ?> <?php
<?php } elseif ($data->status == 2) { ?> <span class="status scheduled"> <?php echo Yii::t('Dashboard.views', 'Ready for Review'); ?> </span> <?php } elseif (!$data->isPublished()) { ?> <span class="status scheduled"> <?php echo Yii::t('Dashboard.views', 'Scheduled for {{date}}', array('{{date}}' => CHtml::tag('abbr', array('data-original-title' => Cii::formatDate($data->published), 'title' => Cii::formatDate($data->published, 'c')), Cii::formatDate($data->published)))); ?> </span> <?php } else { ?> <span class="status published"> <?php echo CHtml::tag('abbr', array('data-original-title' => Cii::formatDate($data->published), 'title' => Cii::formatDate($data->published, 'c'), 'class' => 'timeago'), Cii::formatDate($data->published)); ?> </span> <?php } ?> </div> <div class="clearfix"></div> </div>