Fórum

Birthday calendar format

thumbnail
Kevin Gebel, modificado 12 Anos atrás.

Birthday calendar format

Junior Member Postagens: 80 Data de Entrada: 27/05/10 Postagens Recentes
Hello

I have created a hook for the create account page. After a couple of hours, I am still not able to customize the format of the birthday datepicker :
The birthday field is displayed to the following format : month / day / year + datepicker.
I'd like to obtain this format : day / month / year + datepicker.

Has anyone got an idea ?
Thanks
Kevin
thumbnail
Sandeep Nair, modificado 12 Anos atrás.

RE: Birthday calendar format

Liferay Legend Postagens: 1744 Data de Entrada: 06/11/08 Postagens Recentes
You may want to create hook for the following jsp

portal-web\docroot\html\taglib\ui\input_date\page.jsp

Just change the order of the includes

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

					&lt;%
					int[] monthIds = CalendarUtil.getMonthIds();
					String[] months = CalendarUtil.getMonths(locale);
					%&gt;

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

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

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


Regards,
Sandeep
thumbnail
Kevin Gebel, modificado 12 Anos atrás.

RE: Birthday calendar format

Junior Member Postagens: 80 Data de Entrada: 27/05/10 Postagens Recentes
That's the solution. Thanks Sandeep !
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Birthday calendar format

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi Sandeep,

i also tried in changing the format of birthday date. i dont want the year to be displayed. so i removed the following lines in the file html\taglib\ui\page.jsp.
now in UI it is displaying fine. but problem is i am not able to modify the date. Database doesnt accept the new value without year.
Also i was unable to change other fields like Suffix, prefix, Gender, if i remove the year in birthday field
need ur help!!!!!!!!!!1 urgent


Thanks
Udaya.R
Oliver Bayer, modificado 12 Anos atrás.

RE: Birthday calendar format

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Udaya,

you have two possible ways to solve this. Frist you can set the year input field as hidden. The drawback is that users with some knowledge and firebug can "hack" it and change the value. The other solution would be to modify the save method so that if the year is null then use the year previously entered.

HTH Oli
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Birthday calendar format

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi Oliver,
Actually my problem is none of the link on the user's details page is linkable after removing the lines from page.jsp.
i dont know what is the link between the birthday year and this fields.
if i tried to change the prefix field, we will get the "modified" text on right side. that is not showing up.
i have attached my page with this for ur reference


Thanks,
Udaya.R
thumbnail
Udaya Ramakrishnan, modificado 12 Anos atrás.

RE: Birthday calendar format

Junior Member Postagens: 67 Data de Entrada: 07/09/11 Postagens Recentes
hi,
Finally 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
Oliver Bayer, modificado 12 Anos atrás.

RE: Birthday calendar format

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Udaya,

if the links on the right aren't clickable any more -after you removed the year field- I think this could be a javascript issue. Can you inspect this via firebug and check if you get any js errors? If so try to solve them so you can use your solution with the removed year field.

Another css hack would be to use "display: none;" if no js errors are thrown.

Looking at the taglib code I think you can disable the year selection completly. All you have to do is to add the "disabled=true" parameter to the jsp where the input date taglib is called.

Greets Oli