Im using simple form in my app to get the users birthday.
It is set (and I want to keep it this way) to go back to year 1900 but I was wondering if there is a way to have the default start be like 1950 (they can still scroll back to older if they need) so most users dont have to scroll so far to get to their age.
<%= f.input :date_of_birth, :as => :date, :start_year => 1900,
:end_year => Date.today.year - 12,
:order => [ :day, :month, :year], :required => true %>
Thanks!
You can just switch the :start_year value with the :end_year value to have
<%= f.input :date_of_birth, :as => :date, :start_year => Date.today.year - 12,
:end_year => 1900,
:order => [ :day, :month, :year], :required => true %>
As the :start_year and :end_year is just the way you display the year...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With