From my form , using jQuery Datepicker , I get dates in textfields already formatted as : Parameters: { "project"=>{ "start_shooting_date"=>"Mercredi 1 Février, 2012", "latest_publish_date"=>"Mercredi 8 Février, 2012"}...} 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 erwin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ahmy Yulrizka
2012-Jan-25 22:48 UTC
Re: anyway to parse a localized date string into a Date object ?
Checkout http://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html#method-c-parse assuming you use 1.9.3, there is also #strptime Ahmy Yulrizka On Thu, Jan 26, 2012 at 4:55 AM, Erwin <yves_dufour-ee4meeAH724@public.gmane.org> wrote:> From my form , using jQuery Datepicker , I get dates in textfields > already formatted as : > > Parameters: { "project"=>{ "start_shooting_date"=>"Mercredi 1 > Février, 2012", "latest_publish_date"=>"Mercredi 8 Février, > 2012"}...} > > 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 > > erwin > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Erwin
2012-Jan-26 07:22 UTC
Re: anyway to parse a localized date string into a Date object ?
Thanks , I already tried that , but it''s a localized string... Date.parse("Mercredi 1 Février, 2012") even if the I18n.locale = :fr ( french) it raises an error => ArgumentError: invalid date On Jan 25, 11:48 pm, Ahmy Yulrizka <ahmy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Checkouthttp://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html#method-c-... > assuming you use 1.9.3, there is also #strptime > > Ahmy Yulrizka > > > > > > > > On Thu, Jan 26, 2012 at 4:55 AM, Erwin <yves_duf...-ee4meeAH724@public.gmane.org> wrote: > > From my form , using jQuery Datepicker , I get dates in textfields > > already formatted as : > > > Parameters: { "project"=>{ "start_shooting_date"=>"Mercredi 1 > > Février, 2012", "latest_publish_date"=>"Mercredi 8 Février, > > 2012"}...} > > > 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 > > > erwin > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.