summaryrefslogtreecommitdiff
path: root/rt/share/html/RTx/Statistics/DurationAsString
diff options
context:
space:
mode:
authorivan <ivan>2010-12-05 00:06:28 +0000
committerivan <ivan>2010-12-05 00:06:28 +0000
commit8304b6b00f1be8d09c714b854e17960d225e0928 (patch)
tree32343820126695cc48cba2728da0cdceb7fcb1b9 /rt/share/html/RTx/Statistics/DurationAsString
parente16a0b663d39225ec9caaa39e8531d7346639016 (diff)
RTx-Statistics in 2.1 / 3.8
Diffstat (limited to 'rt/share/html/RTx/Statistics/DurationAsString')
-rwxr-xr-xrt/share/html/RTx/Statistics/DurationAsString18
1 files changed, 18 insertions, 0 deletions
diff --git a/rt/share/html/RTx/Statistics/DurationAsString b/rt/share/html/RTx/Statistics/DurationAsString
new file mode 100755
index 000000000..c0b4d9af4
--- /dev/null
+++ b/rt/share/html/RTx/Statistics/DurationAsString
@@ -0,0 +1,18 @@
+<%$days|'00'%> days <%$hours|'00'%>:<%$minutes|'00'%>
+<%INIT>
+
+my $MINUTE = 60;
+my $HOUR = $MINUTE*60;
+my $DAY = $HOUR * 24;
+my $WEEK = $DAY * 7;
+my $days = int($Duration / $DAY);
+$Duration = $Duration % $DAY;
+my $hours = int($Duration / $HOUR);
+$hours = sprintf("%02d", $hours);
+$Duration = $Duration % $HOUR;
+my $minutes = int($Duration/$MINUTE);
+$minutes = sprintf("%02d", $minutes);
+</%INIT>
+<%ARGS>
+$Duration => undef
+</%ARGS>