3
votes

Has anyone run into this problem? I have a User object and a simple_form which asks for the User's birthday.

  <%= f.input :birthday, as: :date, start_year: Date.today.year - 70,
                      end_year: Date.today.year, order: [:month, :day, :year], label: false %>

Any date I pick I can only pick a day up to the 12th of each month. If I pick 13th or higher simple_form says "Please enter a valid date". Very strange.

I got this code from https://github.com/plataformatec/simple_form and all it says about this code is "SimpleForm accepts same options as their corresponding input type helper in Rails". Does anyone know where the corresponding input type helper in Rails is documented?

2

2 Answers

2
votes

I would guess that you've confused :day and :month somewhere.

0
votes

Or maybe, put differently, you want to use the American format and instead you're using the european format (or the reverse). Not sure it will help, but see this link: How can I use US-style dates in Rails using Ruby 1.9?