diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-12-13 13:22:18 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-12-13 13:22:18 -0800 |
commit | 6d769244a6aa43877c04e227637c80ae1f0a410b (patch) | |
tree | 69a0d8afb8d7deedc3afe80ff54ed1240bcd9968 /httemplate | |
parent | 845355bf3864661dd37f52996c73a09599110b8d (diff) |
fix bandwidth graph date selection for d/m/y, RT#39029
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/view/svc_port.cgi | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/httemplate/view/svc_port.cgi b/httemplate/view/svc_port.cgi index 24717a761..58702eb84 100644 --- a/httemplate/view/svc_port.cgi +++ b/httemplate/view/svc_port.cgi @@ -42,9 +42,16 @@ my $html_foot = sub { my $url = $nms->port_graphs_link($svc_port->serviceid); my $link = $url ? qq(<A HREF="$url">Torrus Graphs</A><BR><BR>) : ''; - if($start && $end) { - $graph = "<BR><BR><IMG SRC=${p}/view/port_graph.html?svcnum=$svcnum;". - "start=".str2time("$start 00:00:00").";end=".str2time("$end 23:59:59").">"; + if ( $start && $end ) { + my($s, $e) = ($start, $end); + if ( $date_format eq '%d/%m/%Y' ) { + $start =~ /^\s*(\d+)\D+(\d+)\D+(\d+)\s*$/ and $s = "$2/$1/$3"; + $end =~ /^\s*(\d+)\D+(\d+)\D+(\d+)\s*$/ and $e = "$2/$1/$3"; + } + $graph = "<BR><BR><IMG SRC=${p}/view/port_graph.html?svcnum=$svcnum". + ";start=".str2time("$s 00:00:00"). + ";end=". str2time("$e 23:59:59"). + ">"; } return ' |