[Rt-commit] r18859 - rt/3.999/branches/datetime/lib/RT/Model

sartak at bestpractical.com sartak at bestpractical.com
Thu Mar 19 16:00:25 EDT 2009


Author: sartak
Date: Thu Mar 19 16:00:21 2009
New Revision: 18859

Modified:
   rt/3.999/branches/datetime/lib/RT/Model/Transaction.pm

Log:
Use RT::DateTime for reporting changes to Told

Modified: rt/3.999/branches/datetime/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/3.999/branches/datetime/lib/RT/Model/Transaction.pm	(original)
+++ rt/3.999/branches/datetime/lib/RT/Model/Transaction.pm	Thu Mar 19 16:00:21 2009
@@ -929,11 +929,9 @@
     told => sub {
         my $self = shift;
         if ( $self->field eq 'told' ) {
-            my $t1 = RT::Date->new();
-            $t1->set( format => 'ISO', value => $self->new_value );
-            my $t2 = RT::Date->new();
-            $t2->set( format => 'ISO', value => $self->old_value );
-            return _( "%1 changed from %2 to %3", $self->field, $t2->as_string, $t1->as_string );
+            my $old = RT::DateTime->new_from_string($self->new_value);
+            my $new = RT::DateTime->new_from_string($self->old_value);
+            return _( "%1 changed from %2 to %3", $self->field, $old, $new );
         } else {
             return _(
                 "%1 changed from %2 to %3",


More information about the Rt-commit mailing list