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,8 +66,7 @@ public class XMLDateConverter extends DateTimeConverter
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* (non-Javadoc)
|
|
||||||
* @see javax.faces.convert.DateTimeConverter#getTimeZone()
|
* @see javax.faces.convert.DateTimeConverter#getTimeZone()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -78,17 +77,21 @@ public class XMLDateConverter extends DateTimeConverter
|
|||||||
return TimeZone.getDefault();
|
return TimeZone.getDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* (non-Javadoc)
|
|
||||||
* @see javax.faces.convert.DateTimeConverter#getLocale()
|
* @see javax.faces.convert.DateTimeConverter#getLocale()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Locale getLocale()
|
public Locale getLocale()
|
||||||
{
|
{
|
||||||
// Note: this forces the display of the date to the server's timezone - it does not
|
// get the locale set in the client
|
||||||
// take into account any client specific timezone
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
return Locale.getDefault();
|
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