Bug: Dates do not properly display in Geoportal Web interface for non-Gregorian locales
When searching by date on the Geoportal search or administration pages, the dates are values that do not follow the Gregorian calendar and may increment or decrement in the search interface with each consecutive search, such as in the example shown here.
The Geoportal Web application relies on Java to provide the date for metadata registration, search by date, harvesting time stamp, and other functions. This is problematic because Java returns a date based on the locale of the Java Virtual Machine (JVM), which may not be based on the Gregorian calendar. Users in countries where the geoportal server system locale does not use the Gregorian calendar, such as in Thailand, may experience this behavior.
By changing the JAVA_OPTS setting on the Geoportal host server to reference a Gregorian locale (such as the United States locale), the locale is forced into one that the Geoportal can use for date settings.
This workaround assumes that Tomcat is the servlet container software used in the geoportal deployment, and that the Tomcat catalina.bat file is available.
- Navigate to the \\Tomcat\bin directory and open the catalina.bat file in a text editor.
- Find the JAVA_OPTS setting line.
- At the end of the line, append locale information to JAVA_OPTS to reference Gregorian region values. Add or edit a '-Duser.region' parameter.
Leave the language (the '-Duser.language' parameter) set to the locale language when the region parameter references a Gregorian locale.
See the example below where the language is Thai and the region is the United States:
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -Duser.language=th -Duser.region=US
- Save the catalina.bat file.
- Start Tomcat with startup.bat.
- Test the date behavior.