掲示板

Change date format

14年前 に Yannick Ongena によって更新されました。

Change date format

Junior Member 投稿: 26 参加年月日: 10/02/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
14年前 に Lisa Simpson によって更新されました。

RE: Change date format

Liferay Legend 投稿: 2034 参加年月日: 09/03/05 最新の投稿
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
14年前 に Corné A によって更新されました。

RE: Change date format

Liferay Legend 投稿: 1313 参加年月日: 06/10/03 最新の投稿
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??
14年前 に Yannick Ongena によって更新されました。

RE: Change date format

Junior Member 投稿: 26 参加年月日: 10/02/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...
6年前 に Daniel Fernandez によって更新されました。

RE: Change date format

Junior Member 投稿: 29 参加年月日: 17/03/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