dhtml_calendar Plugin and dates

Man I am frustrated. 4 hours working on this and i can't find an
answer. Here it goes.

I had some simple date select fields on a form. Then I wanted to add
some additional datetime fields on a form with a nice widget so I
installed the dhtml_calendar plugin. Now my migrations and forms don't
work on insert stating that the argument is out of range.

Here is line #62 in the plugin:
when Date then "'#{quoted_date(Time.local(value.year, value.month,
value.day, 0, 0, 0))}'"

I believe it's got something to do with the date format (2007-12-23)
that i'm using but I can't figure it out. HELP!

vendor/plugins/dhtml_calendar/lib/extensions/active_record.rb:62:in
`local'
vendor/plugins/dhtml_calendar/lib/extensions/active_record.rb:62:in
`quote'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/mysql_adapter.rb:221:in
`quote'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2576:in
`attributes_with_quotes'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2574:in
`each'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2574:in
`attributes_with_quotes'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2496:in
`create_without_callbacks'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:220:in
`create_without_timestamps'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/timestamp.rb:29:in
`create'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2472:in
`create_or_update_without_callbacks'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/callbacks.rb:207:in
`create_or_update'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2206:in
`save_without_validation!'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/validations.rb:911:in
`save_without_dirty!'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/dirty.rb:83:in
`save_without_transactions!'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:110:in
`save!'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:79:in
`transaction'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:98:in
`transaction'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:110:in
`save!'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:118:in
`rollback_active_record_state!'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/transactions.rb:110:in
`save!'

Hello,

First of all, you should always post your environments settings with
your question.

I think you could try and parse the string you receive to a date
before inserting it into the database.

Something like parsed_date = Date.parse(params[:date_field]) should do
the tric

I hope it helps you.

Geoffroy