Sonata change default format_date

后端 未结 1 1665
我寻月下人不归
我寻月下人不归 2021-01-26 00:09

I have installed the SonataIntlBundlebundle. The default format_date results in a format like day-number month-name year.

{{ date_time_ob

相关标签:
1条回答
  • 2021-01-26 00:19

    {{ date_time_object | format_date('MM-dd-yyyy', 'nl') }} would work. As defined in the bottom of the documentation.

    Edit

    To do it globally you can extend DateTimeHelper class and set sonata.intl.templating.helper.datetime.class parameter to that class in app/config/config.yml.

    0 讨论(0)
提交回复
热议问题