Help with Ruby Date Compare

Posted by Kevin on Stack Overflow See other posts from Stack Overflow or by Kevin
Published on 2010-04-14T20:37:58Z Indexed on 2010/04/14 20:53 UTC
Read the original article Hit count: 289

Filed under:
|

Yes, I've read and done teh Google many times but I still can't get this working... maybe I'm an idiot :)

I have a system using tickets. Start date is "created_at" in the timestamps. Each ticket closes 7 days after "created_at". In the model, I'm using:

def closes
  (self.created_at + 7.days)
end

I'm trying to create another method that will take "closes" and return it as how many days, hours, minutes, and seconds are left before the ticket closes. Anyone want to help and/or admonish my skills? ;)

© Stack Overflow or respective owner

Related posts about ruby

Related posts about ruby-on-rails