date_select conversion
1 2 <%=date_select(:date,'',:start_year => 1950,:include_blank => false, :default => { :year => '1970' })%> 3 4 def convert_date(obj) 5 return “#{obj[‘(1i)’]}-#{obj[‘(2i)’]}-#{obj[‘(3i)’]}” 6 end
DZone Snippets > indiehead > select
13469 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
John http://www.red91.com
1 2 <%=date_select(:date,'',:start_year => 1950,:include_blank => false, :default => { :year => '1970' })%> 3 4 def convert_date(obj) 5 return “#{obj[‘(1i)’]}-#{obj[‘(2i)’]}-#{obj[‘(3i)’]}” 6 end