/ Published in: Ruby
Expand |
Embed | Plain Text
def entry_date_humanize( t ) # t:TimeDiff sec = t.to_i if( sec < 60 ) then return sec.to_s + \"s\" elsif( sec < (60*60)) then return (sec/60).to_s + \"m\" elsif( sec < (24*60*60)) then return (sec/60/60).to_s + \"h\" else return (sec/24/60/60).to_s + \"d\" end end
You need to login to post a comment.
