X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fhtml%2FRTx%2FStatistics%2FDurationAsString;fp=rt%2Fhtml%2FRTx%2FStatistics%2FDurationAsString;h=c0b4d9af4410b84f90ec9704b173deff754d29d6;hb=f5af4fcceb8a36c3d0885dfa197798a77de64727;hp=0000000000000000000000000000000000000000;hpb=732703b42a01b98fe6e3a8d032e173d69b48c4e8;p=freeside.git diff --git a/rt/html/RTx/Statistics/DurationAsString b/rt/html/RTx/Statistics/DurationAsString new file mode 100755 index 000000000..c0b4d9af4 --- /dev/null +++ b/rt/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 +