Conversation
…and it does not support d/m/Y format on Ruby 1.9. Cf. https://bugs.ruby-lang.org/issues/634
|
Hi @cure! First of all, thanks for your contribution! Could you check it out again and help me to find which specific format is failing to you? Thanks! |
|
Hi @albertopq, thanks for looking into this. The tests will only fail when the date you feed in (in d/m/Y format) does not also work as m/d/Y. So, 3/1/2012 will work (because it is valid in both formats - though the translation will of course be wrong in one case), but 31/1/2012 will fail. Specifically, d/m/Y is failing for me with Date.parse (but only if d is > 12, of course). I have my rails app set to d/m/Y by adding these to an initializer: Time::DATE_FORMATS[:default] = '%d/%m/%Y %H:%M:%S' Thanks, |
|
Hi. I have the same issue I think. Rails 1.9.3 and default format is %m/%d/%Y Thanks! |
|
i have 2 dates on my page = f.datepicker 'start_date', {:class => 'datepicker medium-label-1 input small-margin-right', :title=>t(:dates)} the first one passes as it has some data but the second one says that there is no data. ' and when i do get it to pass the format is wrong. how do i change the format of the field |
Stop using Date.parse. it does not support d/m/Y format on Ruby 1.8.x, and it does not support m/d/Y format on Ruby 1.9.
Cf.
https://bugs.ruby-lang.org/issues/634