mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. 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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user