X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FRTx%2FStatistics%2FDurationAsString;fp=rt%2Fshare%2Fhtml%2FRTx%2FStatistics%2FDurationAsString;h=c0b4d9af4410b84f90ec9704b173deff754d29d6;hb=8304b6b00f1be8d09c714b854e17960d225e0928;hp=0000000000000000000000000000000000000000;hpb=e16a0b663d39225ec9caaa39e8531d7346639016;p=freeside.git 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); + +<%ARGS> +$Duration => undef +