This wiki does not contain official documentation and is currently deprecated and read only. Please try reading the documentation on the Liferay Developer Network, the new site dedicated to Liferay documentation. DISCOVER Build your web site, collaborate with your colleagues, manage your content, and more. DEVELOP Build applications that run inside Liferay, extend the features provided out of the box with Liferay's APIs. DISTRIBUTE Let the world know about your app by publishing it in Liferay's marketplace. PARTICIPATE Become a part of Liferay's community, meet other Liferay users, and get involved in the open source project. « Retour - Configure time...
add non-standard timezones
Note that the specified new timezone ids must match those from the class java.util.TimeZone, that may meet most of requires, but if you still want to add a non-standard timezone or want to show a different TimeZone name, then can follow these steps:
1. Add your TimezoneID in portal-ext.properties file:
For example: I add "Australia/WST'(+07:30)" in portal-ext.properties
Asia/Saigon,\
Australia/WST,\
Asia/Shanghai,\
2. Update html\taglib\ui\input_time_zone\page.jsp in your ext environment:
| for (int i = 0; i < timeZones.length; i++) { if(timeZones[i].equals("Australia/WST")){ %> <option <%= value.equals("Australia/WST") ? "selected" : "" %> value="Australia/WST">(UTC +07:30) <%= LanguageUtil.get(pageContext, "australia-wst") %></option> <% } else{ TimeZone curTimeZone = TimeZone.getTimeZone(timeZones[i]); int rawOffset = curTimeZone.getRawOffset(); String offset = StringPool.BLANK; if (rawOffset > 0) { offset = "+"; } if (rawOffset != 0) { String offsetHour = numberFormat.format(rawOffset / Time.HOUR); String offsetMinute = numberFormat.format(Math.abs(rawOffset % Time.HOUR) / Time.MINUTE); offset += offsetHour + ":" + offsetMinute; } %> <option <%= value.equals(curTimeZone.getID()) ? "selected" : "" %> value="<%= curTimeZone.getID() %>">(UTC <%= offset %>) <%= curTimeZone.getDisplayName(daylight, displayStyle, locale) %></option> <% } } |
30835 vues