留言板

Change date format

Yannick Ongena,修改在14 年前。

Change date format

Junior Member 帖子: 26 加入日期: 10-2-22 最近的帖子
I have this wierd problem...
We live in Belgium and we are using the dd/mm/yyyy dateformat.
When i set the locale to nl_BE the interface is in dutch, which is great and the dateformat is ok, which is also good emoticon

However we want to show the interface in English but when i change the locale to en, the dateformat will change to mm/dd/yyyy.
I tried lots of stuff like en_uk, even tried en_BE or en_NL but nothing works. It seems that when you set the interface language in english, no mather the country, it will always be mm/dd/yyyy.
Is their a way to change this so i can have an english interface and a dd/mm/yyyy format?
thumbnail
Lisa Simpson,修改在14 年前。

RE: Change date format

Liferay Legend 帖子: 2034 加入日期: 09-3-5 最近的帖子
I would suggest that you go to the issue tracker and open a bug report. This is part of the internationalization work that needs to be done on liferay. Not all of the internationalization options are language dependent. Currency, date format, etc. are all often country dependent.
thumbnail
Corné A,修改在14 年前。

RE: Change date format

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
Did you try just using the default country settings NL in the system-ext.properties?

    #
    # Set the default locale used by Liferay. This locale is no longer set at
    # the VM level. See LEP-2584.
    #
    user.country=US
    user.language=en


It is like Lisa says most likely the dateformat stems from the java country settings in Java 1.6 this is LocaleElements_uk.java
and for dutch
the strange thing is that the dateFormat is correct d/M/yyyy
            { "DateTimePatterns",
                new String[] {
                    "H:mm:ss z", // full time pattern
                    "H:mm:ss z", // long time pattern
                    "H:mm:ss", // medium time pattern
                    "H:mm", // short time pattern
                    "EEEE, d, MMMM yyyy", // full date pattern
                    "EEEE, d, MMMM yyyy", // long date pattern
                    "d/M/yyyy", // medium date pattern
                    "d/M/yy", // short date pattern
                    "{1} {0}" // date-time pattern
                }
            },



So how did you pick en_UK, just added the locale to the portal-ext.properties??
Yannick Ongena,修改在14 年前。

RE: Change date format

Junior Member 帖子: 26 加入日期: 10-2-22 最近的帖子
Yes i just add the en_UK to the locales in the portal-ext.properties.

I even tried to set the user language to en user country to UK or BE or what ever in the portal-ext but that had the same effect.

When i set the language to dutch, the date is correctly shown in d/m/yyyy but i want an english interface with dutch date settings so when i set country to NL and language to en, he takes the date settings from the language, not the country.

I will create a bug report for this and see what happens...
Daniel Fernandez,修改在6 年前。

RE: Change date format

Junior Member 帖子: 29 加入日期: 17-3-29 最近的帖子
I'm using aui:validator name="date" and it validates in MM/DD/YYYY format, but i want to validate in DD/MM/YYYY.

There is a form to do it without using a function?

Thanks in advance