[Rt-commit] r18714 - in rt/3.999/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Thu Mar 5 19:45:12 EST 2009
Author: sartak
Date: Thu Mar 5 19:45:12 2009
New Revision: 18714
Modified:
rt/3.999/trunk/ (props changed)
rt/3.999/trunk/lib/RT/DateTime.pm
Log:
r80976 at onn: sartak | 2009-03-05 19:40:50 -0500
If new_from_string fails to parse, return an empty RT::DateTime
Modified: rt/3.999/trunk/lib/RT/DateTime.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/DateTime.pm (original)
+++ rt/3.999/trunk/lib/RT/DateTime.pm Thu Mar 5 19:45:12 2009
@@ -69,7 +69,13 @@
$args{time_zone} = $class->_canonicalize_time_zone($args{time_zone});
}
- return $class->SUPER::new_from_string($string, %args);
+ my $dt = $class->SUPER::new_from_string($string, %args);
+
+ if (!defined($dt)) {
+ return RT::DateTime->from_epoch(epoch => 0);
+ }
+
+ return $dt;
}
sub _canonicalize_self {
More information about the Rt-commit
mailing list