[Rt-commit] r5151 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Wed May 3 16:14:10 EDT 2006
Author: ruz
Date: Wed May 3 16:14:09 2006
New Revision: 5151
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/Date.pm
Log:
r2812 at cubic-pc: cubic | 2006-05-04 00:17:28 +0400
* Diff without argument diff against now()
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Date.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Date.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Date.pm Wed May 3 16:14:09 2006
@@ -272,8 +272,8 @@
# {{{ sub SetToNow
sub SetToNow {
- my $self = shift;
- return($self->Set(Format => 'unix', Value => time))
+ my $self = shift;
+ return($self->Set(Format => 'unix', Value => time))
}
# }}}
@@ -289,11 +289,12 @@
sub Diff {
my $self = shift;
- my $other = shift;
+ my $other = shift || time;
if ( UNIVERSAL::isa( $other, 'RT::Date' ) ) {
- $other=$other->Unix;
+ $other = $other->Unix;
}
+
return ($self->Unix - $other);
}
# }}}
More information about the Rt-commit
mailing list