diff options
author | ivan <ivan> | 2007-06-20 22:28:28 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-06-20 22:28:28 +0000 |
commit | f5af4fcceb8a36c3d0885dfa197798a77de64727 (patch) | |
tree | 4a1d6ec0be2a409d83dac63a3001728d3c2306aa /rt/html/RTx/Statistics/Elements/DurationAsString | |
parent | 732703b42a01b98fe6e3a8d032e173d69b48c4e8 (diff) |
integrate RTx::Statistics package, part of merging spiritone RT changes (#1661)
Diffstat (limited to 'rt/html/RTx/Statistics/Elements/DurationAsString')
-rwxr-xr-x | rt/html/RTx/Statistics/Elements/DurationAsString | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rt/html/RTx/Statistics/Elements/DurationAsString b/rt/html/RTx/Statistics/Elements/DurationAsString new file mode 100755 index 000000000..c0b4d9af4 --- /dev/null +++ b/rt/html/RTx/Statistics/Elements/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> |