[Rt-commit] rt branch, 4.4/ticket-negative-time-hour-unit, created. rt-4.4.4-51-gdcc013a87

? sunnavy sunnavy at bestpractical.com
Mon Jul 29 08:21:18 EDT 2019


The branch, 4.4/ticket-negative-time-hour-unit has been created
        at  dcc013a87d9a8cd0b2725535230a139e05cf4ce7 (commit)

- Log -----------------------------------------------------------------
commit dcc013a87d9a8cd0b2725535230a139e05cf4ce7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jul 24 04:38:52 2019 +0800

    Use hours when possible for negative ticket time durations strings
    
    Previously negative ticket time durations were always shown as minutes,
    which is inconvenient.

diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 38708af5f..4de9f705a 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -1398,7 +1398,7 @@ sub _DurationAsString {
     my $self = shift;
     my $value = shift;
     return "" unless $value;
-    if ($value < 60) {
+    if (abs $value < 60) {
         return $self->loc("[quant,_1,minute,minutes]", $value);
     } else {
         my $h = sprintf("%.2f", $value / 60 );

-----------------------------------------------------------------------


More information about the rt-commit mailing list