Strange I18n date output with rails

前端 未结 3 757
长情又很酷
长情又很酷 2020-12-20 15:10

I\'ve got a strange problem with date translations in my Ruby On Rails 3 application, and I really don\'t understand why...

Here are my en.yml and

3条回答
  •  执念已碎
    2020-12-20 15:34

    Where do these wrong "formats" come from ?

    Because created_at is a DateTime, rails using time formats (not date).

    https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml#L195

    time:
      am: am
      formats:
        default: ! '%a, %d %b %Y %H:%M:%S %z'
    

提交回复
热议问题