|
Re: Changing date format of DateTime widget [message #115076 is a reply to message #115039] |
Tue, 09 December 2008 10:17   |
Eclipse User |
|
|
|
Originally posted by: ifurnadjiev.innoopract.com
Hi Setya,
the format of date in DateTime widget depends on client (browser) locale
(language). If the browser content language is en-US the format will be
MM/dd/yyyy, but if it is German (de-de) for example, the format will be
dd/MM/yyyy. To check this you can set in Firefox your preferred language
in Options -> Content -> Languages and see the result. Anyway, there is
no explicitly way to set to format if DateTime widget. This is the same
in SWT.
Best,
Ivan
Setya wrote:
> Hi,
>
> Is it possible to change the date format in DateTime Widget ? When I
> first try it, the format is MM/dd/yyyy, I want to change it into
> dd/MM/yyyy.
>
> Regards,
>
> Setya
>
|
|
|
|
Re: Changing date format of DateTime widget [message #940894 is a reply to message #115076] |
Thu, 11 October 2012 23:29  |
Eclipse User |
|
|
|
Please try with code:
public class LocaleConfig {
public static final String LOCALE_COUNTRY_DEFAULT = "VN";
public static void setDefaultLocale() {
Locale locale = RWT.getLocale();
if (LOCALE_COUNTRY_DEFAULT.equals(locale.getCountry())) {
return;
}
Locale defaultLocale = null;
Locale[] locales = Locale.getAvailableLocales();
for (Locale loc : locales) {
if (LOCALE_COUNTRY_DEFAULT.equals(loc.getCountry())) {
defaultLocale = loc;
break;
}
}
if (defaultLocale != null) {
RWT.setLocale(defaultLocale);
}
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03629 seconds