diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-19 09:09:53 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-19 09:09:53 +0100 |
commit | 407b3f5167959ad9357559964570d164bc87d13b (patch) | |
tree | 39bf6006ba7da2dfacb88098786904b66cdf636d /timepollhead.rb | |
parent | 6c68e78ad2af45da251e1d1dad3dde22836690f1 (diff) |
add times works correct now
Diffstat (limited to 'timepollhead.rb')
-rw-r--r-- | timepollhead.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/timepollhead.rb b/timepollhead.rb index ffda6c0..464b1fc 100644 --- a/timepollhead.rb +++ b/timepollhead.rb @@ -33,7 +33,11 @@ class TimePollHead end end def to_s - "#{@date} #{time_to_s}" + if @time + "#{@date} #{time_to_s}" + else + @date.to_s + end end def inspect "TS: date: #{@date} time: #{@time ? time_to_s : "nil"}" @@ -113,6 +117,7 @@ class TimePollHead # columnid should be never used as changing title is not usefull here # returns parsed title def edit_column(columnid, newtitle, cgi) + delete_column(columnid) if columnid != "" parsed_date = TimeString.new(newtitle, cgi.include?("columntime") ? cgi["columntime"] : nil) @data << parsed_date @data.uniq! @@ -267,6 +272,9 @@ END ret += "<input type='hidden' name='deletecolumn' value='#{timestamp.to_s}' />" else ret += "<input type='hidden' name='new_columnname' value='#{timestamp.date}' />" + if @data.include?(TimeString.new(day,nil)) + ret += "<input type='hidden' name='columnid' value='#{TimeString.new(day,nil).to_s}' />" + end end ret += <<END |