FrontEndUsers import dates into a User Property

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

FrontEndUsers import dates into a User Property

Post by webform »

I have to import a file of new users to FEU and one FEU User Property is a date field (birthday), but FEU won't let me import dates past 1970-01-02.
Is where a work-around so i can import users with birthdays before 1970-01-02?

I've tried different formatting including using Unix Timestamp but to no avail.

I was thinking using a text property for birthday, but i have to calculate an users age in frontend for search purpose, so i'm not sure it's at good idea!
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1922
Joined: Mon Jan 29, 2007 4:47 pm

Re: FrontEndUsers import dates into a User Property

Post by Jo Morg »

unix timestamp in a text field should probably be the best option, but you'd have to typecast to integer in the templates for sorting. But that would be my choice.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: FrontEndUsers import dates into a User Property

Post by webform »

I think i maybe found a workable work-around;

Create a User Property in FEU and set it as Type Text.
Convert birthdays in the import file to a Unix Timestamp.
Import the users.
Convert the User Property in FEU to Type Date.

My little test sample seems to convert to the correct birthday for the user, but i'll have to do some more testing to be sure.
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: FrontEndUsers import dates into a User Property

Post by webform »

OK! Some further test shows it seems not to matter if the date is imported to a User Property (Type Text) as an Unix Timestamp or like YYYY-MM-DD format.

As soon i convert the User Property (Type Text) to Type Date it looks to output the correct birthdate for the user.

The question now is what is the smartest format to choose?

Will choosing one over another format, paint me into a corner at some point, if i need to search for a users age or birthday?
Post Reply

Return to “Modules/Add-Ons”