[Rt-commit] r7398 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Thu Mar 29 21:27:06 EDT 2007
Author: ruz
Date: Thu Mar 29 21:27:05 2007
New Revision: 7398
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
Log:
r4865 at cubic-pc: cubic | 2007-03-30 05:12:16 +0400
* add _ParseDate
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm Thu Mar 29 21:27:05 2007
@@ -937,6 +937,22 @@
}
}
+sub _ParseDate {
+ my $value = shift;
+ # never
+ return $value unless $value;
+
+ require RT::Date;
+ my $obj = RT::Date->new( $RT::SystemUser );
+ # unix time
+ if ( $value =~ /^\d+$/ ) {
+ $obj->Set( Value => $value );
+ } else {
+ $obj->Set( Format => 'unknown', Value => $value, Timezone => 'utc' );
+ }
+ return $obj;
+}
+
1;
# helper package to avoid using temp file
More information about the Rt-commit
mailing list