RE: Allow empty birthdate for Users

thumbnail
Dominik Marks, modified 5 Years ago. Regular Member Posts: 149 Join Date: 8/29/12 Recent Posts
In one of our portals we allow users to register themselves. We also ask for the birthdate, but that is not a required field.

If you do not enter a birthdate, it seems that Liferay saves 1970-01-01 as the birthdate. Is it possible somehow to differ between users who do not have a birthdate and users which are really born on 1970-01-01? What would be the best approach here?
thumbnail
Syed Ali, modified 5 Years ago. New Member Posts: 15 Join Date: 5/28/14 Recent Posts
Please share the Liferay Version you are using
Lee Jordan, modified 5 Years ago. Expert Posts: 449 Join Date: 5/26/15 Recent Posts
Nothing productive to add but one of our users was furious that we had allowed his birthday to be seen in Liferay and that he hadn't given consent for us to have it. His birthday was Jan 1st 1970. Legit story. Why do we have birthdate in liferay? If for audience targeting just a year would do. Same for gender.
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Well, I actually had a client who showed the birthdays of the week in his portal. Without the age, of course, just that somebody has a birthday. So, we wouldn't have needed a year, just the month and day. It's terribly hard to make everybody happy ...
And it is actually a bit annoying that the gender field is a boolean. We have customers in the medical area who need the gender "unspecified". Also, with the transgender movement and everything, maybe this field should actually be changed to something more flexible.
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
I don't think it is possible to distinguish afterwards. The only idea I have is to create a UserLocalServiceWrapper and change the birthdate in addUserWithWorkflow to something impossible like 1800-01-01. Assuming that you don't create users with a birthdate, of course.
And then ask the users gently to set their birthdate.
thumbnail
Olaf Kock, modified 5 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Back in 6.2, birthday and gender could be disabled through portal.properties.
This is no longer in the list for 7.2, making me expect that these properties have moved to OSGi configuration values. I currently have no time to hunt for them, but maybe the possibility for configuring this makes you confident enough to go look for it. I try to remember this and look for it later, if nobody preempts me.
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
It's still there. Under Instance settings.
thumbnail
Russell Bohl, modified 5 Years ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts
Yep, birthday can be disabled (enabled by default in my 7.2.x build) at Instance Settings > Users > Fields
Enable Gender and Autogenerate Screen Names booleans are also there.
See attached.
thumbnail
Dominik Marks, modified 5 Years ago. Regular Member Posts: 149 Join Date: 8/29/12 Recent Posts
Thank you for all the answers and the interesting discussion.

For my case I will probably try to change the "default" date from 1970-01-01 to something else like 1800-01-01.