掲示板

birthdate is not going to update using ContactModel.setBirthday(Date )

12年前 に Gauri Bansode によって更新されました。

birthdate is not going to update using ContactModel.setBirthday(Date )

Junior Member 投稿: 44 参加年月日: 11/05/04 最新の投稿
Hi,

I am getting one problem with liferay's com.liferay.portal.model.ContactModel.setBirthday(Date arg0) method.
I am using liferay6.0.6 version.

I want to set the specific date to the user's birthday using " user.getContact().setBirthday(date); " but whatever the date object i am pasing to setBirthday() method ,its not going to set to it. that means user's birthday is not changing,it remains the same.

Here is my sample code:

          Date date =new Date(); 
                   date.setDate(birthDate);
		   date.setMonth(birthMonth);
		   date.setYear(birthYear);
		   date.setHours(00);
		   date.setMinutes(00);
		   date.setSeconds(00);
		   date.setTime(0);

                 [b][u][/u] user.getContact().setBirthday(date);      [/b]
                  ContactLocalServiceUtil.updateContact(user.getContact());
    


Here, i am using java's Date class depricated methods.but even if i use Calender class and its methods....still that setBirthday() method is not working.
I am not getting why that setBirthday() method is not working. If anybody knows the solution or if i am wrong somewhere please help me.

Thanks in advance.

Regards,
Gauri B
Aikon Labs Pvt. Ltd.
thumbnail
12年前 に Thiago Leão Moreira によって更新されました。

RE: birthdate is not going to update using ContactModel.setBirthday(Date )

Liferay Legend 投稿: 1449 参加年月日: 07/10/10 最新の投稿
How are you testing if the date was or not updated? If you are login with the user and using a LDAP to import your users this won't work. You gonna have to update the date in your LDAP server because when the LDAP logins your user the process also import and update the user and its birth date as well.
12年前 に Gauri Bansode によって更新されました。

RE: birthdate is not going to update using ContactModel.setBirthday(Date )

Junior Member 投稿: 44 参加年月日: 11/05/04 最新の投稿
Hi,
Thanks Thiago for your reply...i got the solution on it.

Regards,
Gauri B
Aikon Labs Pvt. Ltd.