Added date format to long periods of time

This commit is contained in:
Arturo Gonzalez 2017-05-18 17:01:15 +02:00
parent f56587e11c
commit 8141dac798
1 changed files with 36 additions and 11 deletions

View File

@ -1025,10 +1025,17 @@ function graphic_combined_module ($module_list, $weight_list, $period,
elseif ($temp_range <= SECONDS_1MONTH) {
$time_format = 'M d';
$time_format_2 = 'H\h';
}
else {
}
elseif ($temp_range <= SECONDS_1MONTH) {
$time_format = 'M d';
$time_format_2 = 'H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = 'M d';
$time_format_2 = 'H\h';
}
else {
$time_format = "M Y";
}
// Set variables
@ -3807,9 +3814,12 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
}
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = 'M d H\h';
$time_format = "M Y";
}
$timestamp_short = date($time_format, $timestamp);
@ -3930,8 +3940,11 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = 'M d H\h';
$time_format = "M Y";
}
// Flash chart
@ -4150,8 +4163,11 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
elseif ($period < SECONDS_1MONTH) {
$chart_time_format = 'M d H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$chart_time_format = "M d H\h";
}
else {
$chart_time_format = 'M d H\h';
$chart_time_format = "M Y";
}
// Calculate source indexes
@ -4276,8 +4292,11 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '',
elseif ($period < SECONDS_1MONTH) {
$chart_time_format = 'M d H\h';
}
else {
$chart_time_format = 'M d H\h';
elseif ($period < SECONDS_6MONTHS) {
$chart_time_format = "M d H\h";
}
else {
$chart_time_format = "M Y";
}
// Calculate min, max and avg values
@ -4572,8 +4591,11 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = 'M d H\h';
$time_format = "M Y";
}
$timestamp_short = date($time_format, $timestamp);
@ -4747,8 +4769,11 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
else {
$time_format = 'M d H\h';
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = "M Y";
}
$legend = array();