aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--timepollhead.rb1
-rw-r--r--timestring.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/timepollhead.rb b/timepollhead.rb
index de91636..be900e2 100644
--- a/timepollhead.rb
+++ b/timepollhead.rb
@@ -228,6 +228,7 @@ END
end
times = concrete_times
+ times.delete("") # do not display empty cell in edit-column-form
realtimes = times.collect{|t|
begin
Time.parse(t) if t =~ /^\d\d:\d\d$/
diff --git a/timestring.rb b/timestring.rb
index ff4a220..3f70104 100644
--- a/timestring.rb
+++ b/timestring.rb
@@ -55,8 +55,9 @@ class TimeString
self <=> other
end
def <=>(other)
+ return -1 if other.class != TimeString
if self.date == other.date
- if self.time.class == String && other.time.class == String
+ if self.time.class == String && other.time.class == String
self.time.to_i == other.time.to_i ? self.time <=> other.time : self.time.to_i <=> other.time.to_i
elsif self.time.class == Time && other.time.class == Time
self.time <=> other.time