-1

我的基于 Grails 的多语言网站有一个区域设置开关。我想确保日期值显示在语言环境集中(以及当前在脚手架的其他输出中使用的格式,因为该站点已经可供客户使用)。这是我正在使用的示例代码:

<g:formatDate date="${eventInstance?.date}"/>
4

1 回答 1

1

按照手册中的此条目提出的解决方案是:

<g:formatDate date="${eventInstance?.date}" formatName="default.date.format.short" />

并在我的 i18n/*.properties 文件设置中default.date.format.short(全局标准,,default.date.format已经设置为另一种格式)。

于 2015-05-05T13:40:50.490 回答