diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-21 09:35:48 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-21 09:35:48 +0100 |
commit | 8d757f5f03ea9d551d1715bfa7064eba07e0edb4 (patch) | |
tree | e9c2d6a34c4837c05de56821e14c2fdd6accc13f /timepollhead.rb | |
parent | 47eadddd01601b083c83b3520568255fdd6378a1 (diff) |
bugfix for 2 edit_column issues (can delete now whole days and day is not removed when last time is removed)
Diffstat (limited to 'timepollhead.rb')
-rw-r--r-- | timepollhead.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/timepollhead.rb b/timepollhead.rb index b839a11..6840377 100644 --- a/timepollhead.rb +++ b/timepollhead.rb @@ -123,7 +123,20 @@ class TimePollHead # returns true if deletion sucessfull def delete_column(columnid) - @data.delete(cgi_to_id(columnid)) != nil + col = cgi_to_id(columnid) + if col.time + @data.delete(cgi_to_id(columnid)) != nil + @data << TimeString.new(col.date,nil) unless date_included?(col.date) + else + deldata = [] + @data.each{|ts| + deldata << ts if ts.date == col.date + } + deldata.each{|ts| + @data.delete(ts) + } + return !deldata.empty? + end end def parsecolumntitle(title) |