hi all , i have a strange problem here.i want the date in (mm-dd-yy) fromat. From the view i am getting the value to the controller function. But when the date value is passed to the model for validation i come across a strange thing. if the date entered is greater than 12 ,i get nil value. it wroks perfectly if it si less than or equal to 12. can any one plz help me out.. thanks in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jon Thomas wrote:> hi all , i have a strange problem here.i want the date in (mm-dd-yy) > fromat. From the view i am getting the value to the controller function. > But when the date value is passed to the model for validation i come > across a strange thing. if the date entered is greater than 12 ,i get > nil value. it wroks perfectly if it si less than or equal to 12. can > any one plz help me out.. thanks in advance.I had a similar thing when I was working with uk dates (dd-mm-yyyy) if the date entered can''t be validated by ParseDate then it just returns nil. You can extend this to modify the validation see here for an example: http://source.mihelac.org/articles/2006/09/13/parsing-european-date-format-in-ruby-rails Cheers Luke -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi luke, thank u somuch for the quick reply.i thought of validating the date in the controller itself as in controller am getting the correct value. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---