From 2c7b447c0d5d352b573630d82062ee50e74dc0f4 Mon Sep 17 00:00:00 2001 From: neingeist Date: Tue, 11 Jul 2006 15:48:44 +0000 Subject: [PATCH] lustige datumsformate behandeln --- neinomat-termine | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neinomat-termine b/neinomat-termine index ae41dbd..054009b 100755 --- a/neinomat-termine +++ b/neinomat-termine @@ -81,7 +81,12 @@ end # Get a real date termine.each do |termin| - termin["date"] = Date.parse(datum2isodate(termin["datum"])) + if termin["datum"] !~ /^[0-9]{2}\.[0-9]{2}\.[0-9]{4}.*$/ + puts "#{termin["datum"]} looks funny, fall back to today." + termin["date"] = Date.today() + else + termin["date"] = Date.parse(datum2isodate(termin["datum"])) + end end termine = termine.sort do |x,y|