Posted By

rduv on 10/10/06


Tagged

helper


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Netzach
webstic


date


 / Published in: Ruby
 

  1. def gmail_date_format(date)
  2. Time.now.beginning_of_day <= date ?
  3. date.strftime('%I').to_i.to_s + date.strftime(':%M ') + date.strftime('%p').downcase :
  4. Time.now.beginning_of_year <= date ?
  5. date.strftime('%b ') + date.day.to_s :
  6. date.strftime('%x')
  7. end

Report this snippet  

You need to login to post a comment.