Added compact mode to show timestamp - #4233
This commit is contained in:
parent
1c4b639deb
commit
8fd1f3c99e
|
@ -1169,16 +1169,23 @@ $row++;
|
|||
if ($config['prominent_time'] == 'comparation') {
|
||||
$timestamp = false;
|
||||
$comparation = true;
|
||||
$compact = false;
|
||||
} else if ($config['prominent_time'] == 'timestamp') {
|
||||
$timestamp = true;
|
||||
$comparation = false;
|
||||
$compact = false;
|
||||
} else if ($config['prominent_time'] == 'compact') {
|
||||
$timestamp = false;
|
||||
$comparation = false;
|
||||
$compact = true;
|
||||
}
|
||||
|
||||
$table_other->data[$row][0] = __('Timestamp or time comparation');
|
||||
$table_other->data[$row][1] = __('Comparation in rollover').' ';
|
||||
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', '', $comparation, true);
|
||||
$table_other->data[$row][1] .= '<br />'.__('Timestamp in rollover').' ';
|
||||
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', '', $timestamp, true);
|
||||
$table_other->data[$row][0] = __('Timestamp, time comparation, or Compact mode');
|
||||
$table_other->data[$row][1] = '<div class="switch_radio_button">';
|
||||
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', __('Comparation in rollover'), $comparation, true);
|
||||
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', __('Timestamp in rollover'), $timestamp, true);
|
||||
$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'compact', __('Compact mode'), $compact, true);
|
||||
$table_other->data[$row][1] .= '</div>';
|
||||
|
||||
$row++;
|
||||
|
||||
|
|
|
@ -535,6 +535,10 @@ function ui_print_timestamp($unixtime, $return=false, $option=[])
|
|||
date2strftime_format($config['date_format']),
|
||||
$unixtime
|
||||
);
|
||||
} else if ($prominent == 'compact') {
|
||||
$units = 'tiny';
|
||||
$title = human_time_comparation($unixtime);
|
||||
$data = human_time_comparation($unixtime, $units);
|
||||
} else {
|
||||
$title = date($config['date_format'], $unixtime);
|
||||
$units = 'large';
|
||||
|
|
Loading…
Reference in New Issue