Merges from upstream Kabuki.
This commit is contained in:
@@ -114,15 +114,16 @@ class GenericTable extends PageIndex
|
||||
|
||||
private function parseAllRows($rows, $options)
|
||||
{
|
||||
// Parse all rows...
|
||||
$i = 0;
|
||||
foreach ($rows as $row)
|
||||
foreach ($rows as $i => $row)
|
||||
{
|
||||
$i ++;
|
||||
$newRow = array(
|
||||
'class' => $i %2 == 1 ? 'odd' : 'even',
|
||||
'cells' => array(),
|
||||
);
|
||||
$className = $i & 1 ? 'even' : 'odd';
|
||||
if (isset($options['row_classifier']))
|
||||
$className .= $options['row_classifier']($row);
|
||||
|
||||
$newRow = [
|
||||
'class' => $className,
|
||||
'cells' => [],
|
||||
];
|
||||
|
||||
foreach ($options['columns'] as $column)
|
||||
{
|
||||
@@ -154,7 +155,12 @@ class GenericTable extends PageIndex
|
||||
|
||||
// timestamps: let's make them readable!
|
||||
case 'timestamp':
|
||||
$pattern = !empty($column['parse']['data']['pattern']) && $column['parse']['data']['pattern'] == 'long' ? '%F %H:%M' : '%H:%M';
|
||||
if (empty($column['parse']['data']['pattern']) || $column['parse']['data']['pattern'] === 'long')
|
||||
$pattern = '%F %H:%M';
|
||||
elseif ($column['parse']['data']['pattern'] === 'short')
|
||||
$pattern = '%F';
|
||||
else
|
||||
$pattern = $column['parse']['data']['pattern'];
|
||||
|
||||
if (!is_numeric($row[$column['parse']['data']['timestamp']]))
|
||||
$timestamp = strtotime($row[$column['parse']['data']['timestamp']]);
|
||||
|
||||
Reference in New Issue
Block a user