Foren

liferay-ui:input-date: how change order of day and month fields/boxes?

Simon Read, geändert vor 12 Jahren.

liferay-ui:input-date: how change order of day and month fields/boxes?

New Member Beiträge: 8 Beitrittsdatum: 07.09.11 Neueste Beiträge
Hello,

With the liferay-ui:input-date control, can/how can I change the display ordering of the day and month
fields/text boxes so that day appears to the left of month?
(without changing the liferay jsp file - ...webapps\ROOT\html\taglib\ui\input_date\page.jsp).

Would you be able to provide the steps involved?

Thank you,
Simon
thumbnail
Sandeep Nair, geändert vor 12 Jahren.

RE: liferay-ui:input-date: how change order of day and month fields/boxes?

Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
I think it should automatically set the appropriate date pattern based on the locale. The logic is written in /html/taglib/ui/input_date/page.jsp

However if you still are not able to see the change after appropriate locale is set, you can try creating the jsp hook for the above jsp. But locale should work. The code block which does this change is as follows

<c:choose>
						<c:when test="<%= dateFormatOrder.equals(_DATE_FORMAT_ORDER_MDY) %>">
							&lt;%@ include file="select_month.jspf" %&gt;

							&lt;%@ include file="select_day.jspf" %&gt;

							&lt;%@ include file="select_year.jspf" %&gt;
						</c:when>
						<c:when test="<%= dateFormatOrder.equals(_DATE_FORMAT_ORDER_YMD) %>">
							&lt;%@ include file="select_year.jspf" %&gt;

							&lt;%@ include file="select_month.jspf" %&gt;

							&lt;%@ include file="select_day.jspf" %&gt;
						</c:when>
						<c:otherwise>
							&lt;%@ include file="select_day.jspf" %&gt;

							&lt;%@ include file="select_month.jspf" %&gt;

							&lt;%@ include file="select_year.jspf" %&gt;
						</c:otherwise></c:choose>


Regards,
Sandeep
Simon Read, geändert vor 12 Jahren.

RE: liferay-ui:input-date: how change order of day and month fields/boxes?

New Member Beiträge: 8 Beitrittsdatum: 07.09.11 Neueste Beiträge
Hi Sandeep,

Thank you for your mail.

The page.jsp I am using contains the below (I am using liferay 6.0.5/ 6.0.6 and tomcat 6.0.6/6.0.29):
I am not totally sure how to change the locale but I carried out the following:
I changed the default locale by modifying portal-ext.properties and system-ext.properties in:
...\webapps\ROOT\html\taglib\ui\input_date, and then selected an alternative locale from the language portal.
Changing the locale didn't work and I shall look to use a hook.

with regards,
Simon

------------------------
<c:choose>
<c:when test="<%= monthAndYearParam.equals(namespace) %>">

<%
int[] monthIds = CalendarUtil.getMonthIds();
String[] months = CalendarUtil.getMonths(locale);
%>

<%@ include file="select_month.jspf" %>
</c:when>
</c:choose>

<%@ include file="select_day.jspf" %>

<%@ include file="select_year.jspf" %>
-----------------------------
thumbnail
Udaya Ramakrishnan, geändert vor 12 Jahren.

RE: liferay-ui:input-date: how change order of day and month fields/boxes?

Junior Member Beiträge: 67 Beitrittsdatum: 07.09.11 Neueste Beiträge
hi,
i too have the same requirement of removing year from bithday field in user derails page.

i removed the year by making the select tag as "hidden" in selet_year.jspf from the path \html\taglib\ui\input_date\.

<select style= "visibility:hidden;" <%= disabled ? "disabled=\"disabled\"" : "" %> id="<%= yearParam %>" name="<%= yearParam %>">

can suggest me if any other way of doing this...............



Thanks
Udaya.R
Simon Read, geändert vor 12 Jahren.

RE: liferay-ui:input-date: how change order of day and month fields/boxes?

New Member Beiträge: 8 Beitrittsdatum: 07.09.11 Neueste Beiträge
Hi Udaya

I have changed the ordering of the fields by creating a hook an "overwriting the jsp file".

The changes apply to all portlets.

I am not sure whether it's possible to create a hook for an individual portlet?

regards,
Simon