Default Date Format in Rails (Need it to be ddmmyyyy)

后端 未结 6 1566
野的像风
野的像风 2020-12-03 08:28

I\'ve been working with a rails form all day and I was just randomly testing it and tried the date 25/12/2009 and it came up with a huge error.

It was at this point

6条回答
  •  孤城傲影
    2020-12-03 08:44

    You can change the date format using internationalisation (I18n)

    Just add (or change) this in your config/locales/en.yml:

    en:
      date:
        order:
          - :day
          - :month
          - :year
    

提交回复
热议问题