Liferay input-date format

风格不统一 提交于 2019-11-29 17:40:55

I looked at the input-date taglib code and if you want to change the pattern you have to modify its code. Path to the file: \webapps\ROOT\html\taglib\ui\input_date\page.jsp. Simply you can replace this line:

Format format = FastDateFormatFactoryUtil.getSimpleDateFormat(simpleDateFormatPattern, locale);

with:

Format format = FastDateFormatFactoryUtil.getSimpleDateFormat("dd.MM.yyyy", locale); mask = "%d.%m.%Y";

and save the file. More elegant solution would be creating a hook on this component, but it's up to you.

AFAIK this tag displays the date according to the user's language choice. By default that's en_US, thus mm/dd/yyyy. If you set your user's default language (or your portal's) to en_GB (or de, for example), the format will be according to the language that's used on the UI.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!