Hi,
My apologies if this is a duplicate post, I've done a search but I could have missed the answer to my question.

I have a webform set up with a date field set to default to Date of Birth from my user's profile. However, no matter what the user's date of birth actually is, webform defaults always to January 1, 1970.

Happy for any help!

Comments

vm’s picture

PHP defaults to 1970 , dates before 1970 will not work without the adodb date library from
http://phplens.com/phpeverywhere/adodb_date_library, I the adodb library with the date.module. I do not know if webform works with it.

quicksketch’s picture

I think I understand the scenario here, but could you tell me exactly how your profile field for date of birth and the webform field trying to use it are configured?

pnc999’s picture

To VeryMisunderstood, thanks for your post. Unfortunately I wasn't even trying with people born before 1970 so I do not think this fix will work for my situation.

To quicksketch: the profile field for Date of birth is profile_dob and in my webform I have created a data element = date with the default of %profile[profile_dob]. Is this enough information? Let me know if you need more!

pnc999’s picture

Here's a bit more information about my webform configuration:

The Timezone = Website Timezone which is set to GMT + 1000 (Australia)

Don't know if that is helpful or not, just thought I'd put it in!

quicksketch’s picture

Thanks pnc999, that's just what I was looking for. I'll try to reproduce and see if something is misbehaving in the use of profile fields.

quicksketch’s picture

Title: Date of birth not showing correctly » Allow profile dates for date component
Category: support » feature
Status: Active » Fixed

It doesn't look like webform ever translated date fields from profile module into the default value for webform date components. I've added this feature so that it can take %profile[profile_dob] (or other date fields) and use them as the default value. Profile dates also didn't work in descriptions, which I've also fixed.

pnc999’s picture

Thanks quicksketch - that has fixed that issue nicely.

Anonymous’s picture

Status: Fixed » Closed (fixed)