Anyway to parse a localized date string into a Date object?

From my form , using jQuery Datepicker , I get dates in textfields
already formatted as :

Parameters: { “project”=>{ “start_shooting_date”=>“Mercredi 1
Fvrier, 2012”, “latest_publish_date”=>“Mercredi 8 Fvrier,

is there any way to parse and convert these dates ?

there is a trick: I can store more convertible values in hidden
textfields … but it’s a trick…

thanks for your feedback


assuming you use 1.9.3, there is also #strptime

Ahmy Y.

Thanks , I already tried that , but it’s a localized string…
Date.parse(“Mercredi 1 Fvrier, 2012”)

even if the I18n.locale = :fr ( french)
it raises an error => ArgumentError: invalid date

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs