From e402a4094e035a141ebdc5d8aca4baa7a6da0066 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Fri, 31 Mar 2006 16:18:26 +0000 Subject: [PATCH] . Fix for AWC-600 (Date and time display format no longer picked up from logged in Language) - Changes to the XMLDateConvertor to pickup server time broke the client locale pickup - Checked the odd Thai year format issue is not broken by this fix git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2601 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../ui/common/converter/XMLDateConverter.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/source/java/org/alfresco/web/ui/common/converter/XMLDateConverter.java b/source/java/org/alfresco/web/ui/common/converter/XMLDateConverter.java index 006ee027b6..a98c5527c7 100644 --- a/source/java/org/alfresco/web/ui/common/converter/XMLDateConverter.java +++ b/source/java/org/alfresco/web/ui/common/converter/XMLDateConverter.java @@ -66,29 +66,32 @@ public class XMLDateConverter extends DateTimeConverter return str; } - /* - * (non-Javadoc) + /** * @see javax.faces.convert.DateTimeConverter#getTimeZone() */ @Override public TimeZone getTimeZone() { - // Note: this forces the display of the date to the server's timezone - it does not - // take into account any client specific timezone - return TimeZone.getDefault(); + // Note: this forces the display of the date to the server's timezone - it does not + // take into account any client specific timezone + return TimeZone.getDefault(); } - /* - * (non-Javadoc) + /** * @see javax.faces.convert.DateTimeConverter#getLocale() */ @Override public Locale getLocale() { - // Note: this forces the display of the date to the server's timezone - it does not - // take into account any client specific timezone - return Locale.getDefault(); + // get the locale set in the client + FacesContext context = FacesContext.getCurrentInstance(); + Locale locale = context.getViewRoot().getLocale(); + if (locale == null) + { + // else use server locale as the default + locale = Locale.getDefault(); + } + + return locale; } - - }