. 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
This commit is contained in:
Kevin Roast
2006-03-31 16:18:26 +00:00
parent b29006fbca
commit e402a4094e

View File

@@ -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;
}
}