Treat a timestamp that can't be parse as if it didn't exist.
authorTom Hughes <tom@compton.nu>
Tue, 26 Jun 2007 23:21:20 +0000 (23:21 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 26 Jun 2007 23:21:20 +0000 (23:21 +0000)
lib/osm.rb

index dea48cc..77b07ce 100644 (file)
@@ -101,8 +101,11 @@ module OSM
 
       parser.listen( :characters, %w{ time } ) do |text|
         if text && text != ''
-          date = DateTime.parse(text)
-          gotdate = true
+          begin
+            date = DateTime.parse(text)
+            gotdate = true
+          rescue
+          end
         end
       end