1
0
Fork 0

lustige datumsformate behandeln

This commit is contained in:
neingeist 2006-07-11 15:48:44 +00:00
parent 41fd256df1
commit 2c7b447c0d

View file

@ -81,8 +81,13 @@ end
# Get a real date # Get a real date
termine.each do |termin| termine.each do |termin|
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"])) termin["date"] = Date.parse(datum2isodate(termin["datum"]))
end end
end
termine = termine.sort do |x,y| termine = termine.sort do |x,y|
x["date"] <=> y["date"] x["date"] <=> y["date"]